echo \"for the exit status\" read file1 string grep $string $file1 echo \"the status is \"$? if [ $? -eq 0 ] then echo \" succeed\" else echo \"not succeed\" fi echo \"completed\" OUTPUT ********** [04mca58@LINTEL 04mca58]$ sh exitstatus.sh for the exit status database xyz1 01 xyz1 1000 12-08-2002 the status is 0 succeed completed