Linux runs. / test1.sh with an error, as follows
[[email protected]192 public]# ./test1.sh
-bash: ./test1.sh: /bin/bash^M: bad interpreter: No such file or directory
resolvent
1. Run directly under the shell file directory
[[email protected]192 public]# sed -i 's/\r$//' test1.sh
2. After entering test1.sh, VIM executes set fileformat = UNIX at the bottom, and then executes WQ to save the file
[[email protected]192 public]# vi test1.sh
Run again. / test1.sh succeeded
This work adoptsCC agreementReprint must indicate the author and the link of this article