Thursday, June 21, 2018

Write a shell script that check whether the scanned string is found in a file or not. Display appropriate message. - OS

echo "enter file name"
read f
echo "enter string"
read a;
b=`grep $a $f`;
if [ $? -eq 0 ]
then
echo character found ;
fi

No comments:

Post a Comment