|
|
Question : ksh "." exports positional parameters and bash doesnt
|
|
For Linux RH ES4:
[linuxserver bin] cat t.sh # echo "\$#=$#" echo "\$0=$0" echo "\$1=$1" [linuxserver bin] echo $1
[linuxserver bin] echo $0 $- -bash himBH [linuxserver bin] . ./t.sh bob $#=1 $0=-bash $1=bob [linuxserver bin] echo $1
[linuxserver bin]
for AIX5.3:
aixserver(/home/user/bin)$ cat t.sh # echo "\$#=$#" echo "\$0=$0" echo "\$1=$1" aixserver(/home/user/bin)$ echo $1
aixserver(/home/user/bin)$ echo $0 $- -ksh ism aixserver(/home/user/bin)$ . ./t.sh bob $#=1 $0=-ksh $1=bob aixserver(/home/user/bin)$ echo $1 bob aixserver(/home/user/bin)$
Is this a bug or a feature of ksh? Is this not dangerous? Subsequent tests of $1 always find it.
|
Answer : ksh "." exports positional parameters and bash doesnt
|
|
|
|
|
|