Question

I'm on MacOSX Mountain Lion 10.8.2, using OhMyZsh and for some odd reason, I am not able to run a command which should trigger a script in my local directory. If I navigate via terminal to the folder containing "tidy" (http://w3c.github.com/tidy-html5/) I get an error when trying to run it:

➜ tidy test.html test.min.html zsh: command not found: tidy

My $PATH variable looks very weird in .zshrc (I'm new to zsh, I've always used bash):

export PATH=$PATH:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/Users/Keith/.rvm/bin

Does anyone know what I could do to modify my path to check the local working directory first?

Thanks a ton

Was it helpful?

Solution

The current working directory is . which doesn't appear to be in your $PATH. You can export it the same way you would in bash:

export PATH=.:$PATH

which will add . before the rest of $PATH. You'll need to either source ~/.zshrc or re-open your terminal window to apply the changes. You can check whether . is in the $PATH:

echo $PATH
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top