On 08/18/2011 08:44 AM, Eric Blake wrote:
how do I write a function that would print the same as
$ \ls | cat

Useless use of cat.  This can be done with \ls -1.

f(){ for a in "$@"; do echo "$a"; done; }

Or skip the loop altogether:

f(){ printf %s\\n "%@"; }

--
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Reply via email to