On Mon, Jul 22, 2013 at 6:40 AM, Dan Douglas <[email protected]> wrote:
> On Sunday, July 21, 2013 05:32:33 PM Dan Douglas wrote: > > On Monday, July 22, 2013 12:25:01 AM Irek Szczesniak wrote: > > > On Mon, Jul 22, 2013 at 12:19 AM, Dan Douglas <[email protected]> > wrote: > > > > Hi, > > > > > > > > $ ksh -c 'typeset -i x=1; x+=1 command eval echo \$x' > > > > 1 > > > > > > Why should this work? You're missing a ; character between =1 and > command. > > > > > > Irek > > > > It's intentional. It's valid to export this to a command's environment. > It works in zsh, bash (git), and has worked previously at some point in > ksh93. > > I suppose a better example would include arithmetic. Correct result should > be 3. > > $ ksh -c 'typeset -i x=1; x+=1+1 command eval echo \$x' > 1+1 > It worked with 93u+ 2012-08-01: $ ksh -c 'typeset -i x=1; x+=1+1 command eval echo \$x' 3 $ > $ mksh -c 'typeset -i x=1; x+=1+1 command eval echo \$x' > 2 > $ ~/doc/programs/bash43 -c 'typeset -i x=1; x+=1+1 command eval echo \$x' > 3 > $ zsh -c 'emulate ksh; typeset -i x=1; x+=1+1 command eval echo \$x' > 3 > -- > Dan Douglas > _______________________________________________ > ast-users mailing list > [email protected] > http://lists.research.att.com/mailman/listinfo/ast-users >
_______________________________________________ ast-users mailing list [email protected] http://lists.research.att.com/mailman/listinfo/ast-users
