日期:2014-05-16  浏览次数:20569 次

在linux里关于dash与bash的 问题
用sh执行脚本*.sh文件,其中文件*.sh中包含declare的变量声明,但这样却现实not found declare,用chmod 755 *.sh,然后./*.sh脚本运行正常,或者直接bash  *.sh也能运行,这是因为sh是链接的是dash,不是bash。
Ubuntu安装的时候使用了dash,dash比bash体积小速度快,兼容性高!但是在bash下可以正常运行的一些sh在dash下不能使用,造成了一些麻烦。为了解决之,键入sudo dpkg-reconfigure dash,重新配置dash,并选择“no”,即不使用dash。