syntax error near unexpected token `do [How to Solve]

(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: