How can I associate .sh files with Cygwin?

前端 未结 13 1395
旧时难觅i
旧时难觅i 2021-01-29 21:32

I\'d like to run a long rsync command in Cygwin by double clicking on a .sh file in Windows. It must start in the file\'s containing directory (e.g. /cygdrive/c/scripts/) so th

13条回答
  •  不要未来只要你来
    2021-01-29 22:10

    You should be able to associate .sh files with \CYGWIN\usr\bin\bash.exe. The script will have to change its own working directory, I suggest sticking something like this at the top:

    cd `dirname "$0"`
    

提交回复
热议问题