Forum: Bash / Shell Scripting
May 25th, 2008, 9:29 AM
|
|
Replies: 3
Views: 508
Re: if condition and grep
okay, figured it out.
grep_output=`grep <word> <file>`
if [ "$grep_output" == "" ]; then
echo "not found";
else
echo "found";
fi
|
Forum: Bash / Shell Scripting
May 25th, 2008, 7:39 AM
|
|
Replies: 3
Views: 508
if condition and grep
hey all
im trying to write a script, need some help
concept goes like this: i want to grep a file for a word/phrase, and depending on grep's output (basically, any output at all = found, NULL = not...
|