美文网首页
shell脚本执行source报错

shell脚本执行source报错

作者: jeho0815 | 来源:发表于2019-03-09 18:02 被阅读0次

在Ubuntu 16.04机器在执行shell脚本时,报source: not found
原因是shell脚本执行的时候用的不是bash,而是dash,可以使用下面方法修改。

$ls -l `which sh`    
/bin/sh -> dash    

$dpkg-reconfigure dash     

出现对话框后,选择no,再查看一次

$ls -l `which sh`    
/bin/sh -> bash

重新执行脚本,问题解决

相关文章

网友评论

      本文标题:shell脚本执行source报错

      本文链接:https://www.haomeiwen.com/subject/frlepqtx.html