If there is a colon (:) in the directory name, how can I add it to $ PATH?

I use mac os x, and I have some problems setting up $PATHenv. If the directory name /path/to/add/a:b/bin, how can I add this directory to $PATH, which is split :?

+4
source share
1 answer

As far as I know, you cannot. An obvious way to escape the character :in $PATHwould be to use a backslash, but a quick experiment with Linux's Bash indicates that it does not work. OSX may behave differently, but I suspect you will have the same problem.

. , , $PATH:

 $ cd /path/to/add
 $ ln -s a:b a_b
 $ PATH="$PATH:/path/to/add/a_b/bin"
+3

Source: https://habr.com/ru/post/1525894/


All Articles