个人做网站 优帮云彼亿营销
Ubuntu 24.04.1 LTS系统设置环境变量,执行
source ~/.bashrc
出现错误: source command not found
解决方案:不需要处理( echo 以下你的环境变量,发现是生效的),ubantu系统 中 /bin/sh 通常链接到 dash,这是出于性能考虑。
如果是执行脚本问题,解决办法:
ls -l /bin/sh
显示:lrwxrwxrwx 1 root root 4 Jun 19 23:40 /bin/sh -> dash,这说明使用dash来解析脚本
解决方案:改为bash来解析。
切换到root用户,运行:dpkg-reconfigure dash,在界面中选择no,就ok了。
dpkg-reconfigure dash
在运行:ls -l /bin/sh
显示:lrwxrwxrwx 1 root root 4 Jun 20 01:04 /bin/sh -> bash