Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run .sh script in Intellij in Windows

I have a problem about running sh file in Intellij in Windows.

When I clicked the run button in the file, I got this output shown below.

PS C:\Users\username\IdeaProjects\library> /bin/sh C:/Users/username/IdeaProjects/library/aws-setup.sh
/bin/sh : The term '/bin/sh' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify t
hat the path is correct and try again.
At line:1 char:1
+ /bin/sh C:/Users/username/IdeaProjects/library/aws-setup.sh
+ ~~~~~~~
    + CategoryInfo          : ObjectNotFound: (/bin/sh:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

How can I fix it?

like image 630
S.N Avatar asked Oct 19 '25 13:10

S.N


1 Answers

Set Settings (Preferences on macOS) | Tools | Terminal | Shell path to c:\Program Files\Git\bin\bash.exe or use Shell Script run configuration with Interpreter path set to bash.exe:

bash

like image 189
CrazyCoder Avatar answered Oct 21 '25 04:10

CrazyCoder