zsh没有使用我的$ PATH正确

时间:2014-07-31 21:23:25

标签: bash path zsh oh-my-zsh dotfiles

我尝试从~/.dotfiles/bin运行一个脚本,但是zsh没有得到它而不是bash:

➜  ~  cat ~/.dotfiles/bin/dotfiles-test 
#!/bin/bash
echo 'hello world'
➜  ~  echo $PATH
/usr/local/share/npm/bin/:~/.dotfiles/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
➜  ~  dotfiles-test
zsh: command not found: dotfiles-test
➜  ~  bash
bash-3.2$ source .exports 
bash-3.2$ echo $PATH
/usr/local/share/npm/bin/:~/.dotfiles/bin:/usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin/:~/.dotfiles/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
bash-3.2$ dotfiles-test 
hello world
bash-3.2$ 

1 个答案:

答案 0 :(得分:2)

只需将~/.dotfiles/bin替换为$HOME/.dotfiles/bin