2

I'm using commander to do a lot of job on Windows. My only problem is that I'm not able to run .sh files.

enter image description here

The image above says that there is no program associated to run .sh extension.

My workaround is to type bash file.sh But I rather to do not type bash everytume.

3
  • Does it work if you put #!/bin/bash as first line in your script?
    – dmadic
    Commented May 2, 2018 at 21:06
  • does not works. Commented May 2, 2018 at 22:26
  • 1
    Looks like associating .sh files with bash won't work. I am also on windows and my git-bash is associated to .sh files. When I run .\file.sh it opens git-bash in separate window, executes the script and immediately closes the window. I believe that the best you can do is what this guy proposed stackoverflow.com/a/38317535/7411306.
    – dmadic
    Commented May 2, 2018 at 22:40

2 Answers 2

7

You can try to run the below command to execute shell scripts on cmder windows 10.

sh test.sh
0

I find the easiest way is just to open a new tab (Ctrl + T) and switch to {bash::mintty as Admin}. Then you just run your scripts as usual ./test.sh

Not the answer you're looking for? Browse other questions tagged or ask your own question.