Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm doing this in my .zshrc


and if I do echo $PATH it appears as the first thing in the path. Yet this directory isn't included in the executable path (nor for tab-completion). What am I doing wrong? ls ~/scripts shows the directory as expected.

Edit: This works, though... I guess ~ doesn't work in the path?

share|improve this question

Use $HOME instead.

share|improve this answer
Expansion of ~ in PATH is an abhorrent bashism. The PATH-searching library functions execlp or execvp do not expand ~, so other programs that use them to find and run programs in the PATH would also fail to search ~ entries. – Chris Johnsen May 18 '10 at 21:33
I consider ~ to be a command-line convenience. It shouldn't be used in scripts and variable values for expansion. – Dennis Williamson May 18 '10 at 23:25
@Chris Johnsen, it's amazing, the main impact on my *nix knowledge after switching shells is learning what is universal and what is not. I think zsh is cool, but I've learned quite a bit suffering through the switch (and I'm only two days in). @Dennis Williamson, I'm getting that, and it makes sense, somehow. – Dan Rosenstark May 19 '10 at 0:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.