lijo george
2017-04-25 11:35:25 UTC
Hi,
The attached testscript has a leading double byte space separator before
the for loop closing "done" keyword. This fails with a syntax error while
parsing.
Is it a bug or is it expected behaviour?
I've tried it with ksh93u+ and ksh93v- versions on a Solaris setup.
bash and zsh also fails, hence I'm thinking it might not be a bug, but
could someone please confirm this.
Here's a sample output.
***@S11_3_SRU:~# echo $LANG
ja_JP.UTF-8
***@S11_3_SRU:~# cat space.ksh
#!/bin/ksh
for i in 1 2
do
echo $i
done # leading double byte space character
***@S11_3_SRU:~# od -xc space.ksh
0000000 2321 2f62 696e 2f6b 7368 0a66 6f72 2069
# ! / b i n / k s h \n f o r i
0000020 2069 6e20 3120 320a 646f 0a65 6368 6f20
i n 1 2 \n d o \n e c h o
0000040 2469 0ae3 8080 646f 6e65 0a00
$ i \n 343 200 200 d o n e \n
0000053
***@S11_3_SRU:~# ksh --version
version sh (AT&T Research) 93u+ 2012-08-01
***@S11_3_SRU:~# ksh space.ksh
space.ksh: syntax error at line 6: `for' unmatched
***@S11_3_SRU:~# ./ksh-2014
***@S11_3_SRU:~# echo ${.sh.version}
Version AIJMP 93v- 2014-12-24
***@S11_3_SRU:~# ./space.ksh
./space.ksh: syntax error at line 6: `for' unmatched
***@S11_3_SRU:~#
Thanks,
Lijo
The attached testscript has a leading double byte space separator before
the for loop closing "done" keyword. This fails with a syntax error while
parsing.
Is it a bug or is it expected behaviour?
I've tried it with ksh93u+ and ksh93v- versions on a Solaris setup.
bash and zsh also fails, hence I'm thinking it might not be a bug, but
could someone please confirm this.
Here's a sample output.
***@S11_3_SRU:~# echo $LANG
ja_JP.UTF-8
***@S11_3_SRU:~# cat space.ksh
#!/bin/ksh
for i in 1 2
do
echo $i
done # leading double byte space character
***@S11_3_SRU:~# od -xc space.ksh
0000000 2321 2f62 696e 2f6b 7368 0a66 6f72 2069
# ! / b i n / k s h \n f o r i
0000020 2069 6e20 3120 320a 646f 0a65 6368 6f20
i n 1 2 \n d o \n e c h o
0000040 2469 0ae3 8080 646f 6e65 0a00
$ i \n 343 200 200 d o n e \n
0000053
***@S11_3_SRU:~# ksh --version
version sh (AT&T Research) 93u+ 2012-08-01
***@S11_3_SRU:~# ksh space.ksh
space.ksh: syntax error at line 6: `for' unmatched
***@S11_3_SRU:~# ./ksh-2014
***@S11_3_SRU:~# echo ${.sh.version}
Version AIJMP 93v- 2014-12-24
***@S11_3_SRU:~# ./space.ksh
./space.ksh: syntax error at line 6: `for' unmatched
***@S11_3_SRU:~#
Thanks,
Lijo