On Tuesday, January 15, 2013 11:51:28 AM Greg Wooledge wrote:
> On Tue, Jan 15, 2013 at 11:30:39AM -0500, DJ Mills wrote:
> > I believe that's referring to var=value command, as in the syntax to export
> > a variable into "command"s environment.
> > 
> > readonly a=3
> > a=2 echo foo
> 
> I thought that was what it meant, too, but I couldn't reproduce the "bug"
> that it was claiming to fix.
> 
> imadev:~$ bash-4.2.37 -posix -c 'readonly a=3; a=2 echo foo; echo survived'
> bash-4.2.37: a: readonly variable
> foo
> survived
> 
> imadev:~$ bash-4.1.9 -posix -c 'readonly a=3; a=2 echo foo; echo survived'
> bash-4.1.9: a: readonly variable
> foo
> survived
> 
> imadev:~$ bash-4.1.9 -posix -c 'readonly a=3; a=2 /bin/echo foo; echo 
> survived'
> bash-4.1.9: a: readonly variable
> foo
> survived

 $ bash --posix -c 'readonly a=3; a=2 true; echo survived'
bash: a: readonly variable
survived
 $ bash --posix -c 'readonly a=3; a=2 :; echo survived'
bash: a: readonly variable
 $ bash --posix -c 'readonly a=3; a=2 command :; echo survived'
bash: a: readonly variable
survived
 $
 $ ( n=10 x= POSIXLY_CORRECT=; while printf "${x:-true} "; ((n--)); do x= 
${x:-true ${x:=:}}; done )
true : true : true : true : true : true
 $  ( n=20 x=: POSIXLY_CORRECT=; while printf %s "${x:--) }"; ((n--)); do x= 
${x:-true ${x:=:}}; done )
:-) :-) :-) :-) :-) :-) :-) :-) :-) :-)
-- 
Dan Douglas

Reply via email to