I am using Red Hat Enterprise 5.3, and I'm trying to add a directory to my $path variable, but it has spaces in it. The $path variable is space delimited, so how do I differentiate a space in a absolute path from a space that separates the paths?
Tell me more
×
Super User is a question and answer site for
computer enthusiasts and power users. It's 100% free, no registration required.
|
|
Isn't $PATH colon-delimited? Anyway, you need to escape the spaces with
This path is just an example, don't copy it verbatim. |
|||
|
|
|
It looks like Brad is using csh or tcsh -- these shells have both $path and $PATH. The shell maintains both when you change the one. The way to add the directory with spaces to $path:
|
|||||
|
|
In my case (using csh) the $PATH variable was messing it up and preventing $path from working, so here is a workaround:
Caveat: paths with spaces must be added last, if you add a non-space path to path after this, it will automatically update $PATH and break it again. |
|||
|