Example:
ls | echo
prints nothing ( a blank line, actually ). I'd expect it to print a list of files.
ls | grep 'foo'
, on the other hand, works as expected ( prints files with 'foo' in their name ).
What isI do in these situations is something like:
ls | while read OUT; do echo $OUT; done
but this is rather cumbersome.
Why does piping work with some commands, but not with others ? How can I circumvent this issue ?