Solve the error reported by the running shell
-bash: ./test.sh: /bin/bash^M: bad interpreter: No such file or directory
What is the reason? There is reason to suspect that it is a file format problem? We use VIM test.sh to enter the test.sh file, and then execute it in the bottom mode: set FF to check. The result shows that fileformat = DOS. Look, it is indeed a file format problem. How to solve it?
Solution:
[root@admin .sh]# vim test.sh
Execute: e + + FF = UNIX%, then delete the ^ m symbol
save and exit
or:
[root@admin .sh]# sed -i "s/\r//" test.sh
Or:
[root@admin .sh]# dos2unix test.sh
Or: VIM test.sh open the file, execute: set FF = UNIX, set the file to UNIX, then execute: WQ, and save it in UNIX format.
Read More:
- [Solved] Linux Start jar Error: nohup: failed to run command ‘java‘: No such file or directory
- SLAMBook2 in ch3 code run fatal error: Eigen/Core: No such file or directory
- Yarn install error: 00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: ‘install‘
- ROS Error: Roslaunch got a ‘No such file or directory‘ error while attempting to run xterm -e gdb –args
- [Solved] Docker Error: bad interpreter: Permission denied
- [619]libgtk-3.so.0 or libXt.so.6: cannot open shared object file: No such file or directory
- VSCode Unable to find custom header file directory: fatal error: no such file or directory
- [Solved] kubectl error: sou-bash: _get_comp_words_by_ref: command not found
- [Solved] import cv2 Error: ImportError: libGL.so.1: cannot open shared object file: No such file or directory
- [Solved] ERROR: Could not open requirements file: [Errno 2] No such file or directory : ‘requirments.txt‘
- error while loading shared libraries: lib*.so: cannot open shared object file: No such file or directory
- [Solved] MSYS2+ fatal error: zlib.h: There is no such file or directory
- [Solved] Shell loop execute error: syntax error: bad for loop variable
- crtdbg.h No such file or directory error [How to Solve]
- [Solved] import mxnet Error: OSError: libcudart.so.8.0: cannot open shared object file: No such file or directory
- C++: fatal error: variant: No such file or directory
- [Solved] open failed: ENOENT (No such file or directory)
- [Solved] PostgreSQL Error: Could not connect to server: no such file or directory
- ./popins2: error while loading shared libraries: libbifrost.so: cannot open shared object file: No such file or directory
- How to Solve Hexo init error: bash: hexo: command not found