I’m running Zsh, with my current directory in my path, but the script doesn’t run when used without ./
Read these statements executed in my terminal to understand the context (the » is my shell prompt character):
» ls
Makefile node_modules package.json README.md src test tst
» echo $PATH
.:[all_my_other_directories]
» cat test
echo "test";
nodeunit tst/
» ./test
test
OK: 2 assertions (1ms)
» test
» which test
./test
Notice that on the which test points to the right spot, but test doesn’t run it.
I know that putting my local directory in front of my path is a bad idea, but I’ve changed the path to having . at the end and it doesn’t change anything.
I would greatly appreciate any help!
The keyword
testis reserved because it is actually a shell builtin. To compound the confusion, there is also a shell command also calledtest.Use a different name instead =)