sudo sh test.sh
test.sh ---------
source /etc/profile
-------------------
报错: source: not found
原因:sh和bash是不同的shell,sh中没有source命令。
解决办法:sudo bash test.sh
sudo sh test.sh
test.sh ---------
source /etc/profile
-------------------
报错: source: not found
原因:sh和bash是不同的shell,sh中没有source命令。
解决办法:sudo bash test.sh