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

Re: is variable with variable name possible?



On 2011-04-04 at 22:54 -0400, Aaron Davies wrote:
> > eval "$somevar=\$PWD"
> 
> shirley we have an equiv of bash2's ${!foo}

Sure thing, and just like Bash, it's useful for de-referencing more than
it is for assignment.

${(P)foo}

> i've always advertised zsh as a superset of everything interesting
> from every other shell, please tell me i'm not wrong....

You're wrong.  zsh is a highly capable shell, but there are a myriad of
interesting features out there in other shells.  rc has generalised
file-descriptor plumbing; ksh has named background pools, namespaced
variables, generic character class types for matching (think "\d" in a
glob to match a digit), seeking to an offset in a file in a <redirection
with <#((expr)) and also >#((expr)), and seeking forward automatically
to a pattern with <#pattern.  ksh has discipline functions and probably
more I've missed.

Innovation doesn't only happen in zsh and sometimes we too blatantly
copy from others.

Hrm, anyone know why ksh opens the <>filename on stdout while zsh opens
it on stdin?

-Phil



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