ghostrider
ghostrider

Reputation: 2238

Unable to execute aliases defined in the .bashrc file in gitbash

I have added certain aliases in .bashrc file, that point to the windows location of the start-server bat files of kafka and zookeeper. However when I run those in the gitbash its saying Command not found error

Example if I have below alias in .bashrc file and I run the command zoo in gitbash it gives above error

alias zoo="D:/Tools/kafka_2.13-2.8.0/bin/windows/kafka-server-start.bat"

Upvotes: 0

Views: 332

Answers (2)

Beaumont Muni
Beaumont Muni

Reputation: 21

If you make modifications to you .bashrc file, make sure to source the file right after that at the command prompt and check your permission in order to do it. :

$ source .bashrc

Set any permission to 755 (chmod 755) at the command prompt as well if you are still having difficulties. Usually scourcing should do it.

Upvotes: 0

Roelof
Roelof

Reputation: 121

Gitbash only reads .bash_profile not .bashrc, either place aliases in .bash_profile or place these line on the top of your .bash_profile:

if [ -f ~/.bashrc ]
then
    . ~/.bashrc
fi

also see: Git for Windows doesn't execute my .bashrc file

Upvotes: 1

Related Questions