I have a script I want to run every x seconds until the output changes. With a simple while or until loop, I know how to check the output for a particular string using grep, but what I want to do is continue iterating the loop until the output from the current iteration does not equal the output from the previous iteration.
How can I achieve this in bash?
The closest I've gotten is below, where the command is run twice in each iteration, but this produces extra runs because the while loop cannot remember the output from the previous iteration.
while [ "$(command)" = "$(command)" ]; do sleep 10m; done