Why does the following work:
bash$ ps aux | awk '{ print $1 }'
...but the following not:
print while (<FH>);
close FH;
All the perl example does is print the entire output from ps aux.
bash$ ps aux | awk '{ print $1 }'
...but the following not:
Code:
open FH, "ps aux | awk '{ print $1 }' |" or die $!; print while (<FH>);
close FH;

All the perl example does is print the entire output from ps aux.