[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Simple echo is printing the wrong value
From: |
Greg Wooledge |
Subject: |
Re: [Help-bash] Simple echo is printing the wrong value |
Date: |
Thu, 5 Apr 2012 08:18:06 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Wed, Apr 04, 2012 at 09:24:44PM -0600, Bill Gradwohl wrote:
> IFS= read works
This sets the IFS variable to an empty string for the duration of the
read command.
> set -- '' '' ''
> IFS= echo "${*}" doesn't
You mean it doesn't do what you expected, whatever that was.
> Yes - I know its a parser issue, but its still unexpected.
>
> I'm trying to figure it out.
It expands the positional parameters to a single string using the current
value of IFS (by default, $' \t\n'), and then passes that string to echo
as a single argument. The IFS variable is also set to an empty string
for the duration of the echo command, but since echo doesn't *use* IFS
for anything, that part has no effect.
It's all about the order in which the various steps are performed. Or
in the case of "case", the steps which are omitted.
- Re: [Help-bash] Simple echo is printing the wrong value, (continued)
- Re: [Help-bash] Simple echo is printing the wrong value, Eric Blake, 2012/04/03
- Re: [Help-bash] Simple echo is printing the wrong value, Bill Gradwohl, 2012/04/04
- Re: [Help-bash] Simple echo is printing the wrong value, Bill Gradwohl, 2012/04/04
- Re: [Help-bash] Simple echo is printing the wrong value, Greg Wooledge, 2012/04/04
- Re: [Help-bash] Simple echo is printing the wrong value, Bill Gradwohl, 2012/04/04
- Re: [Help-bash] Simple echo is printing the wrong value, Greg Wooledge, 2012/04/04
- Re: [Help-bash] Simple echo is printing the wrong value, Bill Gradwohl, 2012/04/04
- Re: [Help-bash] Simple echo is printing the wrong value, Greg Wooledge, 2012/04/04
- Re: [Help-bash] Simple echo is printing the wrong value, Chet Ramey, 2012/04/04
- Re: [Help-bash] Simple echo is printing the wrong value, Bill Gradwohl, 2012/04/04
- Re: [Help-bash] Simple echo is printing the wrong value,
Greg Wooledge <=
- Re: [Help-bash] Simple echo is printing the wrong value, Chet Ramey, 2012/04/05
- Re: [Help-bash] Simple echo is printing the wrong value, Bob Proulx, 2012/04/05
- Re: [Help-bash] Simple echo is printing the wrong value, DJ Mills, 2012/04/06
- Re: [Help-bash] Simple echo is printing the wrong value, Eric Blake, 2012/04/04