08/06/25 20:22:07 g812rZ0o
>>251
Sun4 で試したら、未定義でもエラーにならんかったよ。
$ cat test.sh
uname -rvs
VAR="VAL"
[ "${VAR}" = "VAL" ] && 'true'
[ x"${VAR}" = x"VAL" ] && 'true'
unset VAR
[ "${VAR}" = "VAL" ] && 'true'
[ x"${VAR}" = x"VAL" ] && 'true'
$ /bin/sh -x test.sh
+ uname -rvs
SunOS 4.1.4-JL 2
VAR=VAL
+ [ VAL = VAL ]
+ true
+ [ xVAL = xVAL ]
+ true
+ unset VAR
+ [ = VAL ]
+ [ x = xVAL ]