zsh-users
 help / color / mirror / code / Atom feed
From: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
To: Aaron Davies <aaron.davies@gmail.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: is variable with variable name possible?
Date: Mon, 4 Apr 2011 23:54:35 -0400	[thread overview]
Message-ID: <20110405035435.GA97549@redoubt.spodhuis.org> (raw)
In-Reply-To: <BANLkTinC7Mc-goXko88A08yMoctXZ3w9xg@mail.gmail.com>

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


  reply	other threads:[~2011-04-05  3:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-04 13:37 zzapper
2011-04-04 13:48 ` Jérémie Roquet
2011-04-04 13:51   ` Jérémie Roquet
2011-04-04 14:13     ` zzapper
2011-04-04 14:26     ` Bart Schaefer
2011-04-05  8:31       ` Bart Schaefer
2011-04-04 14:06   ` Stephane Chazelas
2011-04-04 14:25     ` Mikael Magnusson
2011-04-04 16:28       ` Stephane Chazelas
2011-04-04 16:34         ` Mikael Magnusson
2011-04-04 20:50           ` Stephane Chazelas
2011-04-04 22:32             ` Mikael Magnusson
2011-04-05 18:39               ` Stephane Chazelas
2011-04-05  2:54             ` Aaron Davies
2011-04-05  3:54               ` Phil Pennock [this message]
2011-04-05  4:04             ` ZyX
2011-04-05  4:10             ` ZyX
2011-04-04 14:33     ` Jérémie Roquet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110405035435.GA97549@redoubt.spodhuis.org \
    --to=zsh-workers+phil.pennock@spodhuis.org \
    --cc=aaron.davies@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).