On 16/12/03 23:33 +0530, Dr. Sharukh K. R. Pavri. wrote: <snip> <reformatted code> perl -e 'while(<>) { @names = split /\s+/; foreach (@names) { print "$_ " if ! (/@/); } print "\n"; } ' < file.
<snip>
I did use it as a single line. Sorry, still does not work :(
Sorry, I missed the opening brace after the if.
[devdas@evita tmp]$ perl -e 'while(<>) { @names = split /\s+/; foreach (@names) { print "$_ " if ! (/@/)}; print "\n" } ' < users Devdas Bhagat Philip S Tellis Parul Mathur Dr. Shahrukh K. R. Pavri
[devdas@evita tmp]$ cat users Devdas Bhagat devdas@dvb.homelinux.org Philip S Tellis philip@ncst.ernet.in Parul Mathur parul.mathur@india.rsystems.com Dr. Shahrukh K. R. Pavri sparvi@vsnl.com
Devdas Bhagat