Hi,
could someone explain why this seems to be right while it seems to be
wrong ?
/opt/ast/bin/ksh -c 'echo ${.sh.version}'
Version JM 93u+ 2012-02-29
/opt/ast/bin/ksh -c 'for i do echo $i; done' 1 2
2
bash, ash and zsh output the same 2 only !
Expected output :
/opt/ast/bin/ksh -c 'for i do echo $i; done' x 1 2
1
2
just for the fun :
ksh88 -c 'for i { echo $i; }' 1 2
2
ksh93 -c 'for i { echo $i; }' 1 2
2
zsh -c 'for i { echo $i; }' 1 2
2
pfff! not so compatible w/ older shells ;^)
ash -c 'for i { echo $i; }' 1 2
1: 1: 1: Syntax error: "{" unexpected (expecting "do")
bash -c 'for i { echo $i; }' 1 2
1: -c: line 0: syntax error near unexpected token `{'
1: -c: line 0: `for i { echo $i; }'
Regards,
Cyrille Lefevre
--
mailto:[email protected]
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users