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.
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", .
/c/Documents and Settings/username
/c/Users/username
, , . , , , :
echo $PATH
script ( , ), . $PATH .bashrc, .
$PATH
.bashrc
, , /bin /usr/bin, , script , , , . , /c/Users/username , /usr/local/bin .
/bin
/usr/bin
/usr/local/bin
You can put it in /bin, which is equivalent C:\Program Files\Git\bin(or similar, depending on where you installed git).
C:\Program Files\Git\bin