9 Jun
2000
9 Jun
'00
06:47
At 08:04 AM 06/09/00 +0200, Koos Pol wrote:
How can I make an 'and' with a regular expression ? I 'm trying to select lines from a file that has "root" and "exit" with grep. Thanks a lot
cat file | grep root | grep exit
cat file | perl -pe '/root/ && /exit/ && print'
-p says print. So that would print all lines once and the ones that match twice. perl -ne 'print if /\broot\b/ && /\bexit\b/' file Of course one would want to define what a word is. Bill Moseley mailto:moseley@hank.org -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/