bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: about one feature in V4.2 against V4.1


From: Dan Douglas
Subject: Re: about one feature in V4.2 against V4.1
Date: Tue, 15 Jan 2013 11:20:47 -0600
User-agent: KMail/4.8.3 (Linux/3.4.6-pf+; KDE/4.8.3; x86_64; ; )

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

[Prev in Thread] Current Thread [Next in Thread]