当前位置: 首页 > 工具软件 > things.sh > 使用案例 >

sudo: unable to execute ./script.sh: no such file or directory

何越
2023-12-01

I just had this exact problem, it turned out to be a text file encoding problem. For me to fix it while running Xubuntu 14.04.3 LTS, I installed dos2unix and converted the script's encoding and then ran the script again using sudo and it worked fine. You can find an example below:

sudo apt-get install dos2unix -y
dos2unix test.sh
sudo chmod u+x test.sh && sudo ./test.sh

参考:http://unix.stackexchange.com/questions/144718/sudo-unable-to-execute-script-sh-no-such-file-or-directory

 类似资料:

相关阅读

相关文章

相关问答