shell脚本无法使用source的原因及解决方法
2017-04-21 14:21
756 查看
现象: shell脚本中source aaa.sh时提示 source: not found
例如:
原因:通过使用一下命令来检查
会提示如下信息:
说明使用了dash来进行解析的。
改回方法:
执行如下命令:
然后会提示如下界面:
然后选中敲回车,然后再次使用
查看结果:
OK,大功告成,此时可以试一试了,如果还提示command not found 则需要重启机器就好了。
原文链接:ubuntu12.04中shell脚本无法使用source的原因及解决方法
例如:
$ source aaa.sh -sh: source: command not found
原因:通过使用一下命令来检查
ls -l `which sh`
会提示如下信息:
lrwxrwxrwx 1 root root 4 Apr 21 13:57 /bin/sh -> dash
说明使用了dash来进行解析的。
改回方法:
执行如下命令:
sudo dpkg-reconfigure dash
然后会提示如下界面:
然后选中敲回车,然后再次使用
ls -l `which sh`
查看结果:
lrwxrwxrwx 1 root root 4 Apr 21 13:57 /bin/sh -> bash
OK,大功告成,此时可以试一试了,如果还提示command not found 则需要重启机器就好了。
原文链接:ubuntu12.04中shell脚本无法使用source的原因及解决方法
相关文章推荐
- ubuntu12.04中shell脚本无法使用source的原因及解决方法
- shell脚本无法使用source的原因及解决方法
- ubuntu12.04中shell脚本无法使用source的原因及解决方法
- ubuntu12.04中shell脚本无法使用source的原因及解决方法
- ubuntu12.04中shell脚本无法使用source的原因及解决方法
- 【linux】Ubuntu中shell脚本无法使用source的原因及解决方法
- debian中shell脚本无法使用source的原因及解决方法
- ubuntu12.04中shell脚本无法使用source的原因及解决方法
- ubuntu12.04中shell脚本无法使用source的原因及解决方法
- ubuntu12.04中shell脚本无法使用source的原因及解决方法
- ubuntu12.04中shell脚本无法使用source的原因及解决方法
- 在ASP.NET中使用IHttpHandler处理请求(如自实现AJAX)时,无法获得Session(或者说是Session 为 null)的原因及解决方法
- 解决debian中脚本无法使用source的问题
- 使用JavaScript脚本无法直接改变Asp.net中Checkbox控件的Enable属性的解决方法
- 各大网站无法使用右键的原因及解决方法
- linux crontab 无法执行shell脚本解决方法
- C#使用DataAdapter.Update(dt)方法,无法批量插入数据的原因及解决
- 使用shell脚本解决VMware克隆主机后网络服务无法启动
- 部分地区移动手机无法使用QQ邮箱IMAP收件原因的分析[附解决方法]