Shell script syntax error near unexpected token ‘$’Do

Problem phenomenon:
Run shell script: Syntax error near unexpected token ‘$’ do\r
Problem analysis:
Nodepad++ does not show a $sign, it should be hidden
Causes:
Open notepad++ and click view -> Display symbol -& GT; Displays all symbols and finds that the return newline characters on Linux and Windows are incompatible
Unix is: & lt; LF> : /n

DOS is: < CR> < LF> : /r/n

MAC is: < CR>/r:
Problem Solving:
Use the DOS2UNIX tool for processing.
Install DOS2UNIX on Linux: Sudo Apt-get install dos2UNIX (install with different commands depending on the system)
After a successful installation, you can define a shell script or execute a command manually
Dos2unix *. Sh
So, as you can see: dos2UNIX: converting File eval1.sh to Unix format…
This will convert this file to an executable file under Linux.

Read More: