Hi, I want to determine a work if it exists in a file. I know that I have no the word in the file, but I get a true 'Yes' reture from below ksh code. Anyone can help me to fix it?
if [ `grep -w "$wd1" $file | wc -w` > 0 ]
then
echo 'Yes'
else
echo 'No word found'
Thanks,
Mike
if [ `grep -w "$wd1" $file | wc -w` > 0 ]
then
echo 'Yes'
else
echo 'No word found'
Thanks,
Mike