I have a simple if loop which is working on one server but not on another. I could grep for the word in myscript.log log file.
#!/bin/ksh
./myscript.sh install $2 $3 $4
sleep 5
if grep -q SUCCESSFUL myscript.log
then
echo "Install is good"
else
echo "Error occured during Install"
fi
Output:
if: Expression Syntax.
Grep outside the script:
mymachine:~>grep SUCCESSFUL myscript.log
Install is SUCCESSFUL
grepexpression withtrueand see if that works.echo $SHELLsay?echo $SHELLoutput is/usr/local/bin/tcshgrepwithtrue. Still I am getting same errorif: Expression Syntax.