Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Bash on Windows - Where to Store and How to Invoke Bash Scripts

Tags:

git

bash

msysgit

Using Git Bash on Windows, if I create a bash script, where do I put it so that I can access it from the bash shell?

Basically, I want to create a bash shell script that does some stuff with files etc.

I want to invoke the function from inside the bash shell with some parameters. The script will then do its work.

I am completely new to this environment. So, my knowledge of bash is very limited.

like image 963
ctorx Avatar asked Aug 20 '10 17:08

ctorx


1 Answers

Well, you can put it anywhere you want. But for ease of use, you might want to put it in your home directory. To find it, open up Git Bash and type the following:

cd ~
pwd

It should return something like /c/Documents and Settings/username (or /c/Users/username). In Windows terminology, that it at "C:\Documents and Settings\username" as you would expect.

like image 122
ewall Avatar answered Oct 21 '22 21:10

ewall