bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: conditional aliases are broken


From: Stefano Lattarini
Subject: Re: conditional aliases are broken
Date: Thu, 18 Aug 2011 19:38:59 +0200
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

Hi Eric.

On Thursday 18 August 2011, Eric Blake wrote:
> 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 "%@"; }
> 
I think you've made a typo here; it should have been: 

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

I guess that's what you meant, right?

BTW, is this behaviour truly portable to other shells and/or printf
utilities?  POSIX seems to require it to portable, but you never
know ...

Regards,
  Stefano



reply via email to

[Prev in Thread] Current Thread [Next in Thread]