The following is the contents of the auto.sh file that was originally run under Linux and is now running under Windows Server. Installed the Cygwin,
#!/bin/sh
#
#Script to Export
#
While:;
Do
php-d session.save_path=/dev/null-f/www/test.php >/dev/null
Sleep 3
Done
Run times wrong
-bash-4.1$./auto.sh
./auto.sh:line 10:syntax error near unexpected tokens ' done '
./auto.sh:line: ' Done '
What is the reason? Did I not install the Cygwin without installing the shell library or why?
When select packages to install
Choose Shells Bash: and bash-completion: What is the reason, willing to use a friend pointing, grateful!
Reply to discussion (solution)
The same problem, seek to solve
Because MS-DOS and windows are carriage return + newline to represent line breaks, so under Linux with Vim to see the code written in the VC under Windows, the "^m" symbol after the end of the line, indicating the character.
Now, you use Vim-b to open your file. You'll find that each row has ^m, so we can replace it with a global replacement.
Address: http://hi.baidu.com/dmkj2008/item/0b58d20c228a9f8e03ce1b46
I saw in Baidu, my is this problem, hope to solve some people's problems