0

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

netpoetica
  • 3,375
  • 4
  • 27
  • 37

1 Answers1

0

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
simont
  • 68,704
  • 18
  • 117
  • 136
  • 1
    Or, alternatively, use `./tidy` (since adding `.` to `$PATH` is considered a security risk by some). – robertklep Feb 24 '13 at 12:54
  • In my situation, I actually had some permissions issues and a bad build of the tidy library, but your answer would be the most valid in the event someone was trying to figure out how to get their commands to run in the current working directory. I have two admin accounts on my computer and permissions were messed up, so I had to run Disk Utility -> Repair Permissions – netpoetica Feb 24 '13 at 16:07