(type 1) (01). It is the format picture under win:
(02). It is a picture in Linux format:
(03) set and display the black blocks above: CRLF and LF
In Notepad + +, first set the view -> Display symbol -> Display all symbols, and then you will see what you expect. All carriage returns and line feeds are windows CRLF
Second, set: Edit -> Document format conversion – > Convert to UNIX format
(04) successful operation:
(second) solution:
There is no need to take the above case as an example. This is a supplementary method:
(1) if the format written on wind is not changed, you can also query and change it on Linux
(2) for example, there is an itcast in the root directory_gdm_user_basic.sh file
(3)vim itcast_gdm_user_basic.sh
(4) after entering, directly enter: set fileformat, and press enter
If the display is fileformat = DOS It means that it is in wind format
If fileformat = UNIX is displayed, it means Linux format
(5) format change: directly enter: set fileformat = UNIX and press enter
(6) reconfirm whether it is successful and re execute (4)
Similar Posts:
- [Solved] “/bin/bash^M: bad interpreter: No such file or directory”
- [Solved] Python Error: /usr/bin/python^M: bad interpreter: No such file or directory
- shell :syntax error: unexpected end of file
- shell :syntax error: unexpected end of file
- Shell script error newline syntax error near unexpected token
- Shell Error: bash: ./a.sh: /bin/bash^M: bad interpreter: No such file or directory [How to Solve]
- Python calculator error: can’t multiply sequence by non-int of type ‘float’
- [Solved] Centos7 Execute Script Error: syntax error near unexpected token `fi’
- Please make sure you have the correct access rights and the repository exists. The problem has been solved when Git clone appears.
- [Solved] Error 1054 (42s22) unknown column ‘password’ in ‘field list’ when updating the password of mysql5.7 or above