If [-N ' $]
Then
echo "111"
Else
echo "222"
Fi
Exit 0
Execute SH my.sh par hint syntax error:unexpected end of file. Error excuse me.
Text editing is a file written by Notepad under Windows, running under the Cygwin simulation Linux software environment.
Solution Idea:
Dos under File and Linux file format differences caused by the problem.
Dos text file is the "R \ n" as the symbol of the break, said 16 into the system is 0D 0 A. The text file under Unix is called \ n as the break mark, which is represented as 16 in 0 a.
"In Windows, two symbols for line wrapping, carriage return \ r, newline symbol \ n, only one symbol in Linux is OK."
DOS format text files in Linux, with a lower version of the vi open at the end will show ^m, of course, may not see, but in VI, will be shown below the format of this file, "M.txt" [dos] 8L, 72C is a DOS file format.
Solution:
You can resolve the above error by using the following command to format the file as UNIX.
VI M.txt
: Set Fileformat=unix
: Wq
Reference Documentation:
Http://hi.baidu.com/hajj1987/blog/item/23339d314e163b275bb5f5ad.html
Section:
Http://wenku.baidu.com/view/4c1e950703d8ce2f00662398.html