How to run .sh file on Windows 7 through Cygwin?

风格不统一 提交于 2019-12-21 03:13:17

问题


I have to use a package on my Windows 7 OS but the package comes only with the .sh file so I have to use bash and hence Cygwin to run on my machine.

But I am kinda familiar with Windows but completely new to Cygwin and shell programming.

Suppose I have a run.sh file in /cygdrive/c/Users/myUserName/Desktop/software/myPackage/bin, how should I run it in Cygwin?

Downloaded Cygwin and in the terminal I navigate to that directory and type run.sh enter but it complains

$ run.sh
-bash: run.sh: command not found

I am asking this because I generally understand in Windows you can just navigate to the directory and run the .bat file and that's it?

How does this work for Cygwin? Any suggestion are highly appreciated!


回答1:


You can run it as:

bash run.sh

Or else:

chmod +x run.sh
./run.sh


来源:https://stackoverflow.com/questions/22722604/how-to-run-sh-file-on-windows-7-through-cygwin

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!