问个shell脚本的问题
在CentOS Linux下面下面的这个脚本能正常运行$ cat foo.sh
#/bin/sh
dir="`pwd`"
echo $dir
dir=${dir%/*}
echo $dir
但是在SunOS 5.10下面,无法运行,提示 bad substitution
bash-3.00# sh -x foo.sh
+ pwd
dir=/opt/JReport/Server_V10.1/derby/bin
+ echo /opt/JReport/Server_V10.1/derby/bin
/opt/JReport/Server_V10.1/derby/bin
foo.sh: bad substitution
要怎么改一下涅
谢谢 ksh,bash都可以 你先贴出在Cento OS的结果
页:
[1]