Skip to content

Instantly share code, notes, and snippets.

@hliang
Created August 22, 2014 22:05
Show Gist options
  • Save hliang/56862e0277a7ce1ea7d6 to your computer and use it in GitHub Desktop.
Save hliang/56862e0277a7ce1ea7d6 to your computer and use it in GitHub Desktop.
Condition evaluation of command output
# condition evaluation of command output
# e.g.
# keep checking whether a file contains PATTERN string
while [[ $(grep -c 'PATTERN' test.txt) == 1 ]]; do echo test.txt contains PATTERN ; date; sleep 2; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment