I've set $PATH to be:-

echo $PATH
/Volumes/3\ TerraBerry/MyShellScripts/:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

and the dir /Volumes/3\ TerraBerry/MyShellScripts/ contains the bash script file - myscript.sh.

But the only way I can exec this script is to

cd /Volumes/3\ TerraBerry/MyShellScripts

and then type


I've managed to do this before, so I can just type


from any PWD. But not now. Anyone see what I'm doing wrong? In Terminal, if I type

open /Volumes/3\ TerraBerry/MyShellScripts/

it does open that folder in Finder.

bash-3.2 OSX 10.12.6

closed as off-topic by Kusalananda, Jeff Schaller, Timothy Martin, slm Jun 12 '18 at 1:09

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Kusalananda, Jeff Schaller, Timothy Martin, slm
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Man...don't use spaces in your dir or filenames. What do you get if you run which myscript.sh? – Jesse_b Oct 1 '17 at 11:56
  • Nothing. Nor if I try which -s myscript.sh – user1321964 Oct 1 '17 at 12:39
  • What do you mean nothing? It should produce something like: /usr/bin/which: no dasiusjhjsdiu in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin) which would indicate whether or not your path was properly set. – Jesse_b Oct 1 '17 at 12:46
  • Ah sorry, damn BSD...what about env | grep 'PATH'. Does that show the same as echo $PATH? – Jesse_b Oct 1 '17 at 12:52
  • Pretty much, except the former first says "PATH=" – user1321964 Oct 1 '17 at 13:16

Browse other questions tagged or ask your own question.