I am using Arch Linux with MATE as desktop environment. So terminal emulator is MATE Terminal. Recently I installed Jekyll with
gem install jekyll. But when I ran
jekyll -v it says
bash: jekyll: command not found. So I tried to add path of Jekyll to PATH variable.
PATH=$PATH/$HOME/.gem/ruby/2.2.0/bin and it worked perfectly. Now I can run jekyll commands. To add it permanently to PATH variable I edited the
~/.bash_profile file like following. It is not working after reboot. But
source ~/.bash_profile works perfectly.
[[ -f ~/.bashrc ]] && . ~/.bashrc
According to ArchWiki this is the proper way to concat something permanantly to PATH. But it isn't working. Can somebody figure me out where the wrong is?
[N. B. : Adding the same line in
~/.bashrc is doing okay.]
Depending on the option it is given,
bash can be run as an interactive shell or login shell. The default interactive shell mode does not read
~/.bash_profile. login shell bash do.
First, some setup:
% cat ~/.bashrc … export BASHRC="yes" … % cat ~/.bash_profile … export BASH_PROFILE="yes" …
Now run a regular (interactive) bash:
% bash [[email protected] ~]$ echo $BASHRC yes [[email protected] ~]$ echo $BASH_PROFILE
Notice we did not get
yes with this last one.
Now with a login shell:
% bash --login [[email protected] ~]$ echo $BASHRC yes [[email protected] ~]$ echo $BASH_PROFILE yes
See paragraph INVOCATION from