如何在cygwin中运行.sh文件?
Jun 23, 2016 pm 02:15 PM 以下是原来在linux下可以运行的auto.sh文件的内容,现在在windows服务器下运行。安装了cygwin、
#!/bin/sh
#
#Script to export
#
while : ;
do
php -d session.save_path=/dev/null -f /www/test.php > /dev/null
sleep 3
done
运行时报错
-bash-4.1$ ./auto.sh
./auto.sh: line 10: syntax error near unexpected token `done'
./auto.sh: line 10: `done'
是什么原因呢?是我没有安装cygwin没有安装shell库还是什么原因呢?
select packages to install时
选Shells bash: 和bash-completion:吗 还是什么原因,愿用过的朋友指点,感激不尽!
回复讨论(解决方案)
同样的问题,求解决
因为MS-DOS及Windows是回车+换行来表示换行,因此在Linux下用Vim查看在Windows下用VC写的代码,行尾后的“^M”符号,表示的是符。
现在,你使用vim -b 打开你的文件。就会发现每一行都有^M ,那么我们可以是用全局替换替换掉
地址:http://hi.baidu.com/dmkj2008/item/0b58d20c228a9f8e03ce1b46
我在百度看到的,我的也是这问题,希望能解决一些人问题

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

11 Best PHP URL Shortener Scripts (Free and Premium)

Working with Flash Session Data in Laravel

Build a React App With a Laravel Back End: Part 2, React

Simplified HTTP Response Mocking in Laravel Tests

cURL in PHP: How to Use the PHP cURL Extension in REST APIs

12 Best PHP Chat Scripts on CodeCanyon
