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
A deterministic finite automaton (DFA) is an abstract machine that reads input from a serial (nonreversible) stream and changes between a finite number of  states according to the

You will design and implement a program that will • analyse the various characteristics of a maze, represented by a particular coding of its basic con- stituents into numbers store

basic steps involved in spreadsheet developement

Multithreaded Calculator In this Lab, you will be implementing a simple multithreaded calculator. Our calculator will accept expressions as infix notation text strings consist

The creation of the menu will involve writing procedural code, using decision logic, writing a loop, and using the case statement.  Although it is not required for grading, it is r

For this assignment you will use the robot/maze simulation example introduced in mini-assignments 0625ma-0627ma to develop a maze-solving program. The program will read a file cont

WRITE A FORTRAN PROGRAMME TO GENERATE PRIME NUMBERS BETWEEN 1 AND 100.

Describe briefly how you might program a computer to exhibit fear or sorrow.

write a program to sort the file sequential order and store on magnetic tape and print sorted tape as the output of the program.

Show that we can represent pairs of nonnegative integers using only numbers and arithmetic operations if we represent the pair a and b as the integer that is the product 2 a 3 b .