Study of UNIX filters like grep, tr, sed etc.
Study of UNIX filters like grep, tr, sed etc.
Code:
clearecho -------------------------------------------------
echo '\tStudying grep,tr,sed commands'
echo -------------------------------------------------
echo Enter the file name
read f1
echo Number of lines in a file is :$(sed -n '$=' $f1)
echo Number of blank lines in a file : $(grep -c '^$' $f1)
echo File content in Uppercase
tr '[ a-z ]' '[ A-Z ]' < $f1
Output:
-------------------------------------------------Studying grep,tr,sed commands
-------------------------------------------------
Enter the file name
t2
Number of lines in a file is :5
Number of blank lines in a file : 2
File content in Uppercase
THIS IS MY
FIRST PROGRAM
SEE SOURCECODEPOINT.BLOGSPOT.COM
Leave a Comment