[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: variable assignments and parameter expansion in a single command
From: |
Kevin F. Quinn |
Subject: |
Re: variable assignments and parameter expansion in a single command |
Date: |
Sun, 25 Mar 2007 12:26:32 +0200 |
On Sat, 24 Mar 2007 19:32:35 -0400
Chet Ramey <chet.ramey@case.edu> wrote:
> Kevin F. Quinn wrote:
> > my interpretation of
> > "variable assignment" is the `A=' part of the statement; i.e. that
> > the rhs of the assignment is expanded.
>
> It's not; the entire word, including the portion after the `=', is a
> variable assignment.
ah; that explains the bash behaviour w.r.t. Posix. I concur, as:
$ A= one
is two words due to the whitespace, so the rhs must be part of the word.
> None of these shells are or claim posix compliance. The Solaris posix
> shell is /usr/xpg4/bin/sh (or something). Of the others, dash is
> closest to Posix compliance.
FWIW I tried also /usr/xpg4/bin/sh (with the Belenix livecd, SunOS
5.11) and that shows the same as sh/ash/dash/bb.
> I don't get these results with bash-3.2. I get "one two" for B both
> times with bash (and ksh93, incidentally).
Sorry; should have said - that was with bash-3.1.17; I should have
tried 3.2. I see the same as you with bash-3.2 (and ksh-93s).
Thanks again for your patience :)
--
Kevin F. Quinn
signature.asc
Description: PGP signature