Reputation: 10997
I created Shell Script on Linux and it runs fine.
Now I want to run the same script on Windows using gitbash
. (Only filepath changed for windows)
I am confused:
or
According TO differences-between-windows-batch-and-linux-bash-shell-script-syntax
Upvotes: 1
Views: 17808
Reputation: 1987
It depends on how advanced the scripts are, but simple scripts can be executed in Git Bash.
test.sh contains:
#!/bin/bash
echo Hello World!
Execute script:
./test.sh
Output:
Hello World!
To answer your question:
@fedorqui in my learning 'cygwin' And 'gitbash' do same stuff for windows
Git Bash
Git Bash is lightweight and only aims to handle:
Read more: http://openhatch.org/missions/windows-setup/install-git-bash
Cygwin
Read more: https://www.cygwin.com/
Upvotes: 2
Reputation: 289525
Of course you can. There is a tool called cygwin
that allows you to do so.
Note that you have to check what the paths are. If so, go to the path you are willing to work on and do pwd
. This way, you will get the Windows\kind\of\path
.
I use it all the time and it works pretty fine.
Upvotes: 3