Pages

Text

Recent Articles

Nike Sports

Ads 468x60px

Recent Posts

Google Plus

Download

Thursday, 12 April 2012

A script reads a pattern name & file name from a user & displays the pattern that is matched into a file onto a screen.Post title


#! /bin/sh
# A script reads a pattern name & file name from a user & displays the pattern that is matched into a file onto a screen.
echo ”Enter the pattern name to be searched”
read pattern
printf ”The entered pattern name is %s /n ” $pattern
echo "Entered file name "
read file
printf "The entered name of the file is %s /n " $file
grep $pattern $file

0 comments:

Post a Comment