![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Grep command | nickg | UNIX for Dummies Questions & Answers | 14 | 10-06-2008 08:22 AM |
| grep command | christine33990 | UNIX for Dummies Questions & Answers | 11 | 05-05-2008 11:45 PM |
| how to exclude the GREP command from GREP | yamsin789 | UNIX for Advanced & Expert Users | 2 | 10-04-2007 11:59 PM |
| grep command help | ishmael^soyuz | Shell Programming and Scripting | 4 | 07-11-2007 06:01 AM |
| grep command | debasis.mishra | Shell Programming and Scripting | 1 | 03-27-2006 10:53 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
grep command
I need to search the follwowing syntax in all the file in the directory
How to user grep command If the below syntax is present it should display if [ 1 -eq 2 ]; then # scissors |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
can u brief your question?
|
|
#3
|
|||
|
|||
|
grep command
I have 300 files in the directory. I need to find out below syntax in which files it is available
if [ 1 -eq 2 ]; then # scissors ps -ef |grep "scissors" *.* (this syntax is not working) |
|
#4
|
|||
|
|||
|
Quote:
if [ 1 -eq 2 ]; What are you trying to do with the # as this is commenting out scissors?! Sorry but what is the ps -ef | grep "scissors *.* supposed to be doing? Also no fi at the end of the if so it will not work anyway! |
|
#5
|
|||
|
|||
|
can u give me the directory structure cos the the syntax what u have given is */* which means that u r searching for a pattern in current directory say
X, 1st * tells to search the pattern in all the directories under X 2nd * i,e /* tells to get into each of * directories under X, search in all the files under each of * directories. Hope u got my pt. rgds, jam |
|
#6
|
|||
|
|||
|
grep
> grep -i scis *
RecreateAIUMajorAccounts:if [ 1 -eq 2 ]; then # scissors venkat This syntax(if [ 1 -eq 2 ]; then # scissors venkat) is present in the file RecreateAIUMajorAccounts |
|
#7
|
|||
|
|||
|
grep '\[ 1 \-eq 2 \]; then' *
Hope this works. I dont know why you are using ps it just lists the processes running in the unix box. The above should help you |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|