Home Linux Write shell script in Linux.

Write shell script in Linux.

47 second read
0
0
275

find the word “UNIX” in all the files given as an argument on the command line. Your script should search each of this files in turn and stop at the file that it encounters containing the word. The file name should be displayed on the screen.


for i in $*

do

grep "UNIX" $i>/dev/null

if [ $? -eq 0 ]

then

echo "File name is : $i"

exit

fi

done

Load More Related Articles
Load More By admin akash
Load More In Linux

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also

Prime Or Not Prime vb.net Program.

Prime Or Not Prime . …