Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATH fails with non-existing directory..



> }
> } Im a rather new user of zsh, so bair with me if this is
> } a well known "feature" :)
> 
> The well-known feature is that `path' (lower case) is an array and `PATH'
> is a colon-separated list.  So when you did this:
> 
> } % path=/usr/bin/:/nonexisting/name
> 
> you told zsh there is only one directory named "/usr/bin/:/nonexisting/name"
> where it should search for commands.
> 
> What you want is either
> 
> % PATH=/usr/bin/:/nonexisting/name
> 
> or
> 
> % path=( /usr/bin/ /nonexisting/name )
> 
> } Every other shell(sh,bash,tcsh) handles this without any error :(
> 
> That's because `path' doesn't have any special meaning to sh and bash
> (so you didn't change the command search path at all in those shells)
> and tcsh doesn't actually use the `path' variable to search for its
> commands (it uses `PATH', which is merely copied from `path').

Ok - then a few questions arises:

1. In which order is path and PATH used ?

2. what can I do to convert a variable from colon-seperated list to an
array ?
e.g. do this: path=list2array(/usr/bin/:/nonexisting/name) => path=(
/usr/bin /nonexisting/name )
I need this as the university im using zsh uses colon-seperated lists
for their systemwide paths 

Best regards,
Max



Messages sorted by: Reverse Date, Date, Thread, Author