Understand |
Hi, could any one tell me (pretty in detail) what the symbol "|" does besides indicates OR in creating a pattern ?
For example, what would happen if i type: grep a * | grep b | grep c ..... ? Thanks a lot |
And by the way, can anyone tell me the best way to write a regular expression to find all words contains a, b and c (in any order) ?
|
'|' does not mean 'or', '||' means 'or'.
'|' is a pipe, which redirects the output from the command on the left, to input of the command on the right... Quote:
|
Thanks for your reply !
Is there a better way to search for such pattern using regular expression ? I came up with thing like: grep -E (.*a.*b.*c.*|.*a.*c.*b.*|.*b.*a.*c.*|.*b.*c.*.a* ......) * but it looked clumsy though. |
All times are GMT -5. The time now is 05:17 AM. |