Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

wwwxxx,nvif, why atm producer might be held liable for economic injury, wwwxxxy=ServiceLogin, w2ksp4.exe, WwwxxXdbf, procmail "FROM_MAILER" patch, Use of assignment to $[ is deprecated at /usr/local/sbin/apxs line 86. , wwwxxx vim, mysql closing table and opening table, 800c5000

Links

XODOX
Impressum

#1: Spaces in Csh Paths

Posted on 2008-04-18 05:33:10 by rodney.longhurst

Is it possible to safely maintain directory names with spaces in a csh
path? This works;

set path = ( /bin /home/space\ bin )

However if a later script tries to add to it;

set path = ( $path /usr/bin )

then the real escaped space is lost, since the set command expands the
$path variable (which is an array) into a flat space-separated string,
then reconstructs it into an array. I know the env variable $PATH,
which is colon-separated, could be used instead (since the csh keeps
$path and $PATH in sync);

setenv PATH "/bin:/home/space\ bin"
setenv PATH "${PATH}:/usr/bin"

but this just shifts the problem to directory names that contain
colons (admittedly much less likely).

Is there a reliable way to set the path to ensure the current contents
are never mangled, or is this just a limitation of the csh?

Report this message

#2: Re: Spaces in Csh Paths

Posted on 2008-04-18 12:52:38 by Maxwell Lol

rodney.longhurst@gmail.com writes:

> Is it possible to safely maintain directory names with spaces in a csh
> path? This works;
>
> set path = ( /bin /home/space\ bin )
>
> However if a later script tries to add to it;
>
> set path = ( $path /usr/bin )

You probably need to use
set path = ( $path:q /usr/bin )

> Is there a reliable way to set the path to ensure the current contents
> are never mangled, or is this just a limitation of the csh?

It's one of many... :-)

Report this message

#3: Re: Spaces in Csh Paths

Posted on 2008-04-20 15:56:11 by rodney.longhurst

Maxwell Lol <nos...@com.invalid> wrote:

> You probably need to use
> setpath= ( $path:q /usr/bin )

Yep, that works perfectly. Thanks very much.

Report this message