When executing the shell script, the following error is prompted:
After searching for information, I found:
carried out:
1
|
vi finddir.sh |
Then, enter
1
|
: set ff |
The results are:
The solution is to modify it to unix:
1
|
: set ff=unix |
Execute the save command:
1
|
:wq |
Execute again:
1
|
: set ff |
Finally execute the command.
There is an error in this article, that is in the script
1
|
if [-d "$folder" ]; then |
To:
1
|
if [ ! -d "$folder" ]; then |
Pro-test so good.
Similar Posts:
- [Solved] “/bin/bash^M: bad interpreter: No such file or directory”
- When Linux runs SHELL file, $’\ R’: command not found appears
- Conversion to MySQL shell script execution error $’\ R’: command not found
- How to Solve Error: set ff? /bin/bash^M: bad interpreter: No such file or directory
- Shell script error newline syntax error near unexpected token
- [Solved] Python Error: /usr/bin/python^M: bad interpreter: No such file or directory
- [Solved] Centos7 Execute Script Error: syntax error near unexpected token `fi’
- Python calls shell script: oserror: [errno 8] exec format err
- shell :syntax error: unexpected end of file
- Shell Error: bash: ./a.sh: /bin/bash^M: bad interpreter: No such file or directory [How to Solve]