[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.
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
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
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
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
"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
"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
> 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.
> 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/
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
"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
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]
12 matches
Mail list logo