[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: weird echo behaviour...
From: |
Dmitry V. Levin |
Subject: |
Re: weird echo behaviour... |
Date: |
Thu, 16 Sep 2004 19:30:55 +0400 |
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.
>
> 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
Yes, that is the way how the shell works, see e.g. "Word Splitting" chapter
in the bash(1) manpage.
Just repeat the test after "set -x" and you'll notice the difference.
--
ldv
pgpGe20EYUGar.pgp
Description: PGP signature
- 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 <=
- Re: weird echo behaviour..., P, 2004/09/17
- Re: weird echo behaviour..., Philip Rowlands, 2004/09/17