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

Re: Setting paths with ~'s in values.



Danny Dulai writes:
 > Quoting Bart Schaefer (schaefer@xxxxxxxxxxxxxxxx):
 > > 
 > >   for t_path in $(<${HOME}/.zpaths)
 > >   do
 > >       if 
 > >           [[ -d $t_path ]]
 > >       then 
 > >           eval path=\( $path $t_path \)
 > >       fi
 > >   done
 > 
 > This didnt seem to add the paths with ~ in them because the ~ didnt get
 > expanded in the test for existence.

Right, silly me.  There was even some discussion of file expansion (or
more accurately, lack thereof) in [[ ... ]] expressions not long after
this.

 > > and you don't need the extra step of removing the leading colon.  But
 > > there's a better, faster, smarter way to do the same thing:
 > > 
 > >   eval path=\( ${^$(<${HOME}/.zpaths)}'(|)(/)' \)
 > 
 > Aftertmuch of fiddling with this, I found it works if I have NULL_GLOB set.

Didn't I send a follow-up about that?  I thought I had ... using (N/)
is exactly the right thing there.



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