[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: some more inline assignments / evaluation wrt POSIX
From: |
Chet Ramey |
Subject: |
Re: some more inline assignments / evaluation wrt POSIX |
Date: |
Sun, 20 May 2007 16:17:16 -0400 |
User-agent: |
Thunderbird 2.0.0.0 (Macintosh/20070326) |
Mike Frysinger wrote:
> testing with bash-3.2p17 here ...
>
> looking at these statements:
> K=dvb0.net A=${K#dvb} echo "$A"
> K=dvb0.net A=${K#dvb} ; echo "$A"
> K=dvb0.net A=${K#dvb} eval echo '$A'
>
> shouldnt "0.net" always be displayed ? looks like A is always set properly
> to "0.net", but in the first statement, $A gets expanded before the variable
> assignments are processed
As Andreas said, variable assignments preceding a command name are
deferred until the rest of the words in the command are expanded.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Live Strong. No day but today.
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/