Grep Command bash script programming Linux UNIX shell programming


Grep command used to filter the data. Example in the redhat.txt file it has the word rhel5. You can list out line with has the word rhel5. So the grep command is used for this purpose.
Source code bash shell Programming Algorithm
[redhat35@localhost Rhel5]$ cat>god
god is great
god is present everywhere
[2]+ Stopped cat>god
echo “displaying a string from a file”
echo “get file name”
read s
echo “get string”
read i
grep $i $s

OUTPUT CS1252 Operating Systems lap
[redhat35@localhost Rhel5]$
displaying a string from a file
get file name
get string
god is great

1 comment:
Write comments