Shell scripts are compatible with linux/unix and windows/cygwin, and are set on notepad: edit-> archive format conversion-> convert to UNIX format. In addition, I think it may be a good habit to display carriage returns and line breaks in my own editor, my "pain" experience (passed string parameters include \ r characters) reason: I need to run shell scripts under cygwin; in the script, the python subscript is called and parameters are passed at the same time. The script content is like this (the called python script prints the parameters passed to it) ========================================================== ======= #! /Bin/sh #====================================#funcion: # autor: luogw # date: 2013/6/27 # usage (in cygwin ):. /checkCompatibility checedFileName(.csv format) newFileName(.csv format, Added Compatibility problem) # comment 'rm-f temp4Compatibility.csv python. /cleanPath. py $1 $ tempFileNamepython. /checkNew. py temp4Compatibility.csv $2 filter.csv filter_key.cs Vrm-f $ tempFileName ==================================== ============== the running conditions are as follows: please pay attention to the value of tempFileName after it is passed to the python script! After \ r is added, let's take a look at the script windows document format and unix document format layout, and display the carriage return line break. notepad settings: view-> display characters-> display all characters in windows format (Script status when a problem occurs) unix format (OK status) My understanding: scripts running in cygwin/unix-like environments, if the shell script is saved in the windows document format (with carriage return and line break), the shell will append the string because the carriage return "\ r" is a common character in the unix environment. In addition, shell scripts in windows document format may appear when running in linux/unix :. /checkCompatibility. sh:/bin/sh ^ M: Bad Interpreter: There is no file or directory (solution is to remove the carriage return and transfer it to the unix document format) however, the cygwin environment can run normally, but it is quite a matter of love, but think about its own implementation is to provide a unix-like running environment in windows, it can handle shell scripts in windows document format, but it is not necessary to handle the issue that I encountered today.