[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: weird echo behaviour...
From: |
Alfred M. Szmidt |
Subject: |
Re: weird echo behaviour... |
Date: |
Thu, 16 Sep 2004 18:04:08 +0200 |
> Could someone explain the following behaviour for me? Because I
> sure do not understand it.
>
> address@hidden:/tmp/foo$ touch 1 2 3 4 5
> address@hidden:/tmp/foo$ foo=`ls`
> address@hidden:/tmp/foo$ /bin/echo $foo
> 1 2 3 4 5
> address@hidden:/tmp/foo$ /bin/echo "$foo"
> 1
> 2
> 3
> 4
> 5
I assume the newlines are the part you don't understand.
That's it.
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? Cause I think it is a annoying behaviour...
- weird echo behaviour..., Alfred M. Szmidt, 2004/09/16
- Re: weird echo behaviour..., Bob Proulx, 2004/09/16
- Re: weird echo behaviour..., Andreas Schwab, 2004/09/16
- Re: weird echo behaviour..., Dmitry V. Levin, 2004/09/17
- Re: weird echo behaviour..., P, 2004/09/17
- Re: weird echo behaviour..., Philip Rowlands, 2004/09/17