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 $ 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
