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
Shopping Cart Purpose – Allows user to browse while keeping track of the items in which they will purchase at the end on the order page link and this will give a final price for al

The next major set of tasks to tackle are delete and update. Version control systems typically version updates to a ?le and only store the differences between the ?les. Two system

This assignment will make use of arrays and functions to simulate a game. ASSIGNMENT DESCRIPTION This program will simulate part of the game of Yahtzee! The player will

Define Functions with no arguments and no return values? When a function has no arguments it doesn't receive any data from the calling function. Likewise, it doesn't return any

Explain the While Statement - Computer Programming? A 'while statement' is an entry controlled loop statement. When the expression is calculated and the condition is not satisf

Provide Example of Function? An illustration of a function definition main() { message(); } /* header */ message() { /*bodystarts here*/ printf ("Example for function

Write a program to show ten buttons with five possible colors: red, green, orange, yellow, blue. When the user clicks on a button, its color must advance to the next color, or go b

This assignment is an individual programming assignment using Perl. It addresses objectives 3, 4, 5 and 8 as listed in the Subject Outline document. The assignment is based on them

i have 4 variables in my linkage section of PIC 9(3) ..while submitting i m passing parameter value i.e. numeic to them but its taking space for 2 varaible and for two its taking c