How to run the. sh file in Cygwin?

Source: Internet
Author: User
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

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.