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

Re: Parameter substitution bug



On Apr 29,  6:07pm, Peter Stephenson wrote:
> Subject: Parameter substitution bug
> Can anybody explain this?
> 
> % cat tst
> print $HOME/bin
> print ~/bin
> fdir='~/bin'
> print ${~fdir}
> setopt globsubst
> print $fdir
> % zsh -f ./tst
> /home/user2/pws/bin
> /home/user2/pws/bin
> ~/bin
> ~/bin
> 
> Why don't the last two give the same as the first two?

Because globsubst and ${~...} only do filename *generation* not filename
*expansion*.  It's always been like this ... you never noticed?

Tilde is not a glob character.

I always thought that using tilde as the turn-on-globsubst character was
a bad idea because it tends to make one think that tilde-expansion will
happen ... but there's really no other character available.



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