Doubt in grep command
+8
akalya
hansi
Nazneennazim
SakeenaHarris
anand
Christopher
Maithreyi
lalitha
12 posters
Page 3 of 3 • 1, 2, 3
Re: Doubt in grep command
I think the single quote doesn't matter in the scenario!!!
Vineet_More- Posts : 27
Points : 31
Join date : 2010-02-26
Re: Doubt in grep command
hmmm okay.. pls come to a conclusion and lemme know..
Saradha Kannan- Posts : 25
Points : 25
Join date : 2010-03-04
Re: Doubt in grep command
Here ^ stands for negation.The output shows all lines which contain characters other than abcd.Since all your lines in the file have characters other than abcd, all lines are printed.
This is the conclusion! And quotes doesn't matter!
This is the conclusion! And quotes doesn't matter!
Maithreyi- Posts : 76
Points : 142
Join date : 2010-03-03
Age : 36
Location : Haldia
Re: Doubt in grep command
okie:) thnx all of ya
Saradha Kannan- Posts : 25
Points : 25
Join date : 2010-03-04
Re: Doubt in grep command
[336560@oracleclient commands]$ cat 5.txt
asdf
1234
asdrg
awsrdq
kjhgkji
[336560@oracleclient commands]$ grep [^asd] 5.txt
1234
According to the conclusion made.,
The output should print all lines which contains characters other than a,s and d. So all lines must have been printed. But it isn't the case.
I thought it works this way. Prints all lines which has neither of the characters inside [ ].
If it works this way,last 2 lines should have been printed. But it isn't the case too
Someone explain.
asdf
1234
asdrg
awsrdq
kjhgkji
[336560@oracleclient commands]$ grep [^asd] 5.txt
1234
According to the conclusion made.,
The output should print all lines which contains characters other than a,s and d. So all lines must have been printed. But it isn't the case.
I thought it works this way. Prints all lines which has neither of the characters inside [ ].
If it works this way,last 2 lines should have been printed. But it isn't the case too
Someone explain.
ARVINTH B.J- Posts : 20
Points : 31
Join date : 2010-02-26
Re: Doubt in grep command
- Code:
cat > 5.txt
asdf
1234
asdrg
awsrdq
kjhgkji
[335818@oracleclient ~]$ grep [^asd] 5.txt
asdf
1234
asdrg
awsrdq
kjhgkji
This is the output I got.I don't understand why you get a different output!
Maithreyi- Posts : 76
Points : 142
Join date : 2010-03-03
Age : 36
Location : Haldia
Re: Doubt in grep command
ls | grep "a*"
is displaying all the files in the directory including those whose names do not contain a
What is the error?
is displaying all the files in the directory including those whose names do not contain a
What is the error?
jennyinhere- Posts : 24
Points : 30
Join date : 2010-02-26
Age : 35
Re: Doubt in grep command
How to use -l with grep command?
jennyinhere- Posts : 24
Points : 30
Join date : 2010-02-26
Age : 35
Re: Doubt in grep command
Syntax
- Code:
$ grep -l 'orange' *
Page 3 of 3 • 1, 2, 3
Similar topics
» GREP TO EXTRACT NON DIGIT FROM EXPRESSION
» awk command doubt
» tee command doubt
» doubt in sort command!!!
» doubt in sort command
» awk command doubt
» tee command doubt
» doubt in sort command!!!
» doubt in sort command
Permissions in this forum:
You cannot reply to topics in this forum
|
|