greycat 1196367878 learn if grep -q word "$file"; then blah blah; fi DO NOT use [[ or [ or ` or $() or any other crap. "if" expects a command. "grep" is a command. "[" is too. You don't need both. Just the grep. TomJ 1253129784 forget TomJ 1253129786 learn if grep -q word "$file"; then blah blah; fi DO NOT use [[ or [ or ` or $() or any other crap. "if" expects a command. "grep" is a command. "[" is too. You don't need both, just the grep works because grep returns true (0) if a match is found, but not otherwise. greycat 1312556137 forget greycat 1312556141 learn if grep -q word "$file"; then blah blah; fi # DO NOT use [[ or [ or ` or $() or any other crap. "if" expects a command. "grep" is a command. "[" is too. You don't need both. Likewise, if foo | grep -q bar; then ...