Weird

Today I wrote a shell script to run on Linux

bash test.sh

Something weird happened

The script didn't report an error, but it didn't run, and it was automatically terminated directly, and a new command line popped out, prompting me to enter a new command

。。。

It is suspected that editing the code on notepad ++ caused the line breaks to be incorrect (Windows and Linux line breaks are not the same)

cat -A test.sh

Found that the newline character is the Linux newline character ($)

Weird

solution:

Copy a shell script that can run successfully, then modify some parameters according to test. Sh as is

success! ! !

It's weird, not even giving me the wrong message. . .

Guess you like

Origin www.cnblogs.com/YlnChen/p/12674496.html