I am trying to modify my PATH in ~/.profile:
export PATH=$PATH:/opt/jdk1.8/bin
echo "Path is exported."
I will always login via SSH so that's why I have it in ~/.profile. I am using zsh (oh-my-zsh) as my default shell and in my ~/.zprofile I am sourcing ~/.profile:
source ~/.profile
The weird part is that when I login over SSH, I see the "Path is exported." message which means that the source statement .zprofile is working but when I echo my $PATH the '/opt/jdk1.8/bin' is missing. If I then manually source ~/.profile, the path is updated properly so I am not sure why it doesn't export the path properly when it gets sourced on login. This is all inside a vagrant box if that helps. Any ideas?
Edit: Output of zsh -ixc exit 2>&1 | grep PATH:
+/home/vagrant/.zcompdump:1254> _postpatcomps=( '(p[bgpn]m*|*top[bgpn]m)' _pbm '(texi(2*|ndex))' _texi '(tiff*|*2tiff|pal2rgb)' _tiff '-value-,(ftp|http(|s))_proxy,-default-' _urls '-value-,LC_*,-default-' _locales '-value-,*path,-default-'
_directories '-value-,*PATH,-default-' _dir_list '-value-,RUBY(LIB|OPT|PATH),-default-' _ruby '*/X11(|R<4->)/*'
_x_arguments 'yodl(|2*)' _yodl )
+/home/vagrant/.zshrc:56> export 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games'
+/home/vagrant/.zcompdump-vagrant-ubuntu-trusty-64-5.0.2:1256> _postpatcomps=( '(p[bgpn]m*|*top[bgpn]m)' _pbm '(texi(2*|ndex))' _texi '(tiff*|*2tiff|pal2rgb)' _tiff '-value-,(ftp|http(|s))_proxy,-default-' _urls '-value-,LC_*,-default-' _locales '-value-,*path,-default-'
_directories '-value-,*PATH,-default-' _dir_list '-value-,RUBY(LIB|OPT|PATH),-default-' _ruby '*/X11(|R<4->)/*'
_x_arguments 'yodl(|2*)' _yodl )
+nvm:409> PATH=+nvm:409> nvm_strip_path /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games /bin
+nvm:409> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
+nvm:411> PATH=+nvm:411> nvm_prepend_path /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games /home/vagrant/.nvm/versions/node/v5.0.0/bin
+nvm:411> PATH=/home/vagrant/.nvm/versions/node/v5.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
+nvm:417> MANPATH=+nvm:417> nvm_strip_path /home/vagrant/.nvm/versions/node/v5.0.0/share/man:/usr/local/man:/usr/local/share/man:/usr/share/man:/opt/jdk1.8/man /share/man
+nvm:417> MANPATH=/usr/local/man:/usr/local/share/man:/usr/share/man:/opt/jdk1.8/man
+nvm:419> MANPATH=+nvm:419> nvm_prepend_path /usr/local/man:/usr/local/share/man:/usr/share/man:/opt/jdk1.8/man /home/vagrant/.nvm/versions/node/v5.0.0/share/man
+nvm:419> MANPATH=/home/vagrant/.nvm/versions/node/v5.0.0/share/man:/usr/local/man:/usr/local/share/man:/usr/share/man:/opt/jdk1.8/man
+nvm:420> export MANPATH
+nvm:422> export PATH
+nvm:424> export 'NVM_PATH=/home/vagrant/.nvm/versions/node/v5.0.0/lib/node'
PATH. What doeszsh -ixc exit 2>&1 | grep PATHshow going on?~/.profilein~/.zprofile?~/.zprofile. In my~/.profile, after I export my modified path, I am sourcing~/.nvm/nvm.sh, which might have something to do with it. I am going to try moving the path exporting to the bottom.~/.profileand still no luck.nvmstuff? (Also, in hindsight,grep -i path=should catch both stringPATHand arraypathassignments.)