Re: weird echo behaviour...

2004-09-17 Thread Andreas Schwab
[EMAIL PROTECTED] writes: > Alfred M. Szmidt wrote: >> [EMAIL PROTECTED]:/tmp/foo$ touch 1 2 3 4 5 >> [EMAIL PROTECTED]:/tmp/foo$ foo=`ls` > > $foo will contain the string 1\n2\n3\n4\n5\n Actually $foo only contains `1\n2\n3\n4\n5', the trailing newline will be chopped off by the shell. Andreas.

Re: weird echo behaviour...

2004-09-17 Thread Philip Rowlands
On Thu, 16 Sep 2004, Alfred M. Szmidt wrote: >Could someone explain the following behaviour for me? Because I sure >do not understand it. > >[EMAIL PROTECTED]:/tmp/foo$ touch 1 2 3 4 5 >[EMAIL PROTECTED]:/tmp/foo$ foo=`ls` Here, ls knows it is not outputting to a terminal, so implies the "-1" op

Re: weird echo behaviour...

2004-09-17 Thread P
Alfred M. Szmidt wrote: Could someone explain the following behaviour for me? Because I sure do not understand it. Yes this is confusing but not incorrect. [EMAIL PROTECTED]:/tmp/foo$ touch 1 2 3 4 5 [EMAIL PROTECTED]:/tmp/foo$ foo=`ls` $foo will contain the string 1\n2\n3\n4\n5\n [EMAIL PROTECTED

Re: weird echo behaviour...

2004-09-17 Thread Dmitry V. Levin
Hi, On Thu, Sep 16, 2004 at 05:21:54PM +0200, Alfred M. Szmidt wrote: > Could someone explain the following behaviour for me? Because I sure > do not understand it. > > [EMAIL PROTECTED]:/tmp/foo$ touch 1 2 3 4 5 > [EMAIL PROTECTED]:/tmp/foo$ foo=`ls` > [EMAIL PROTECTED]:/tmp/foo$ /bin/echo $foo

Re: weird echo behaviour...

2004-09-16 Thread Alfred M. Szmidt
It's useful in cases like "ls | grep", etc. Yeah, but I still don't like it. :) It should figure out automagicly what I want using AI or something.. Anyway, back to my cave. Thanks for all the replies... Happy hacking! ___ Bug-coreutils mailing

Re: weird echo behaviour...

2004-09-16 Thread Andreas Schwab
"Alfred M. Szmidt" <[EMAIL PROTECTED]> writes: > Could someone explain the following behaviour for me? Because I sure > do not understand it. This has nothing to do with echo and everything to do with the shell. > [EMAIL PROTECTED]:/tmp/foo$ touch 1 2 3 4 5 > [EMAIL PROTECTED]:/tmp/foo$ foo=`ls

Re: weird echo behaviour...

2004-09-16 Thread Paul Jarc
"Alfred M. Szmidt" <[EMAIL PROTECTED]> wrote: >Command substitution works by the shell creating a pipe to capture >the output; when ls sees that it is writing to a pipe, it defaults >to -1 instead of -C. > > Urgh, thanks for the explanation. I suppose this can't be changed > right? Ca

Re: weird echo behaviour...

2004-09-16 Thread Alfred M. Szmidt
> Could someone explain the following behaviour for me? Because I > sure do not understand it. You will be slapping your forehead as soon as you realize what is happening. Yeah... Makes all kind of sense in the world now, but I still don't like it.

Re: weird echo behaviour...

2004-09-16 Thread Alfred M. Szmidt
> Could someone explain the following behaviour for me? Because I > sure do not understand it. > > [EMAIL PROTECTED]:/tmp/foo$ touch 1 2 3 4 5 > [EMAIL PROTECTED]:/tmp/foo$ foo=`ls` > [EMAIL PROTECTED]:/tmp/foo$ /bin/echo $foo > 1 2 3 4 5 > [EMAIL PROTECTED]:/tmp/foo$ /bin/

Re: weird echo behaviour...

2004-09-16 Thread Bob Proulx
Alfred M. Szmidt wrote: > Could someone explain the following behaviour for me? Because I sure > do not understand it. You will be slapping your forehead as soon as you realize what is happening. This is normal behavior of the shell passing and processing arguments. > [EMAIL PROTECTED]:/tmp/foo

Re: weird echo behaviour...

2004-09-16 Thread Paul Jarc
"Alfred M. Szmidt" <[EMAIL PROTECTED]> wrote: > Could someone explain the following behaviour for me? Because I sure > do not understand it. > > [EMAIL PROTECTED]:/tmp/foo$ touch 1 2 3 4 5 > [EMAIL PROTECTED]:/tmp/foo$ foo=`ls` > [EMAIL PROTECTED]:/tmp/foo$ /bin/echo $foo > 1 2 3 4 5 > [EMAIL PROT

weird echo behaviour...

2004-09-16 Thread Alfred M. Szmidt
Could someone explain the following behaviour for me? Because I sure do not understand it. [EMAIL PROTECTED]:/tmp/foo$ touch 1 2 3 4 5 [EMAIL PROTECTED]:/tmp/foo$ foo=`ls` [EMAIL PROTECTED]:/tmp/foo$ /bin/echo $foo 1 2 3 4 5 [EMAIL PROTECTED]:/tmp/foo$ /bin/echo "$foo" 1 2 3 4 5 [EMAIL PROTECTED]