美文网首页
shell脚本提示source:not found

shell脚本提示source:not found

作者: 阿当运维 | 来源:发表于2022-08-24 15:23 被阅读0次

问题:

今天执行脚本的时候,加载环境变量文件.env ,执行了source .env 失败。
提示source:not found

原因:

ls -l `which sh` 提示/bin/sh -> dash

此时是用dash来进行解析的。

解决:

命令行执行:

sudo dpkg-reconfigure dash

在界面中选择

no

再次执行

ls -l `which sh` 提示/bin/sh -> bash

修改成功,再次执行已经可以使用了

相关文章

网友评论

      本文标题:shell脚本提示source:not found

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