The shell script written under Windows environment is uploaded to Linux for execution, and an error is reported
-bash: ./databasebak.sh: /bin/bash^M: bad interpreter: No such file or directory
It is suspected that there is a problem with the file format. Use vi databasebak.sh to enter the databasebak.sh file, and then execute it in the bottom mode : set ff Check it and find that fileformat = DOS. Look, it’s really a file format problem
Solution: after entering VI databasebak.sh, in the bottom mode, execute: set fileformat = UNIX and then execute: X or: WQ to save the changes. Then you can execute./databasebak.sh to run the script.
Similar Posts:
- [Solved] “/bin/bash^M: bad interpreter: No such file or directory”
- syntax error near unexpected token `do [How to Solve]
- How to Solve Error: set ff? /bin/bash^M: bad interpreter: No such file or directory
- Python calls shell script: oserror: [errno 8] exec format err
- Conversion to MySQL shell script execution error $’\ R’: command not found
- [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’
- Linux shell script execution error: bad substitution [How to Solve]
- Shell script error newline syntax error near unexpected token
- When Linux runs SHELL file, $’\ R’: command not found appears