Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does $PATH need subdirectories

Tags:

bash

path

macos

Given a $PATH like:

/Users/myname/bin:
/usr/local/Cellar:
/usr/local/Cellar/ruby/1.9.3-p362/bin:
... and so forth

do I really need the ruby location or is /usr/local/Cellar sufficient to find ruby?

like image 542
Lewy Avatar asked Jul 25 '26 19:07

Lewy


1 Answers

The entries are independent of each other, and only count the direct contents. Try it.

> mkdir ~/bin
> mkdir ~/bin/test
> cp /bin/echo ~/bin/test/echotest
> export PATH=$PATH:~/bin
> echotest Hello, world
-bash: echotest: command not found
> rm -rf ~/bin/test
like image 197
Eric Jablow Avatar answered Jul 28 '26 08:07

Eric Jablow



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!