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

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

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

I want to call a function from within Bash with some parameters, and the script will do its job.

I am completely new to this environment, so my knowledge of Bash is very limited.

Thanks in advance.

+5
source share
3 answers

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

cd ~
pwd

- /c/Documents and Settings/username ( /c/Users/username). Windows "C:\Documents and Settings\username", .

+3

, , . , , , :

echo $PATH

script ( , ), . $PATH .bashrc, .

, , /bin /usr/bin, , script , , , . , /c/Users/username , /usr/local/bin .

0

You can put it in /bin, which is equivalent C:\Program Files\Git\bin(or similar, depending on where you installed git).

-3
source

All Articles