Shell script to find a particular pattern from the file, Programming Languages

W.A.S.S to find a particular pattern from the file.

 echo -e "Enter the pattern : \c"

read ptrn

echo -e "Enter the file name : \c"

read fname

grep -E $ptrn $fname

 

Output

 

     sh findp.sh

 Enter the pattern : drw*

Enter the file name : temp3.txt

drwx------ 3 root root 1024 May 12 2005 Desktop

drwx------ 2 root root 1024 Sep 19 00:06 mail

           drwxr-xr-x 2 root root 1024 Nov 23 23:24 narendra

Posted Date: 9/26/2012 8:18:10 AM | Location : United States







Related Discussions:- Shell script to find a particular pattern from the file, Assignment Help, Ask Question on Shell script to find a particular pattern from the file, Get Answer, Expert's Help, Shell script to find a particular pattern from the file Discussions

Write discussion on Shell script to find a particular pattern from the file
Your posts are moderated
Related Questions
1. Write a Perl script that accepts exactly 2 integer arguments where the first argument must be less than the second argument. The script will print a comma separated list of inte

The aims of this assignment are to:    Provide experience in the use of a modern Integrated Development Environment (specifically NetBeans running on a Linux platform) for t

An HTML document may be created via any HTML editor or text editor such as notepad etc.

1. Write a shell script to locate executable files. This script takes a list of file names from the command line and determines which would be executed had these names been given a

What is URL describe theri protocol? URL basicallt stands for uniform resource locator. A URL is a pointer to a particular resource on the Internet at a particular location.

Calculate the total price based on several key parts required to build a state-of-the-art gaming computer. The user will have the option of selecting different parts.

fow to I write a emplate that reads a set of numbers typed at the keyboard into an array of T

Develop a Windows Forms Application by creating a new project named "xxxxxxxx" in a new folder named "xxxxxxxxas3" where xxxxxxxx is your student id. You should delete file(s) with

i need help

Of the 6,325 kindergarten students who participated in the study, almost half or 3,052 were eligible for a free lunch program. The categorical variable sesk (1 == free lunch, 2 = n