From: Aragon Gouveia <aragon@phat.za.net>
To: Eric Blake <eblake@redhat.com>
Cc: dash@vger.kernel.org
Subject: Re: setvar MIA?
Date: Tue, 11 Jan 2011 18:54:04 +0200 [thread overview]
Message-ID: <4D2C8B2C.3060001@phat.za.net> (raw)
In-Reply-To: <4D2C810E.4070707@redhat.com>
Hi,
On 01/11/11 18:10, Eric Blake wrote:
> Decidedly missing. POSIX doesn't require it. Neither bash nor ksh
> provides setvar as a builtin, either. And what does setvar do anyways?
> Perhaps it is some alias or shell function that you have inherited from
> startup files in one of your other shells, but I've never heard of a
> 'setvar' program. So why bloat dash to include it?
It is a builtin in FreeBSD's Bourne shell:
http://www.freebsd.org/cgi/man.cgi?query=sh&apropos=0&sektion=0&manpath=FreeBSD+8.1-RELEASE&format=html
I wasn't sure of its status in POSIX. It is useful for declaring
variable variables - tidier than eval and I imagine faster, eg.
index="1"
setvar var_${index} "value"
Will emulate it with a local function - thanks.
Regards,
Aragon
next prev parent reply other threads:[~2011-01-11 16:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-11 15:54 setvar MIA? Aragon Gouveia
2011-01-11 16:10 ` Eric Blake
2011-01-11 16:54 ` Aragon Gouveia [this message]
2011-01-11 17:00 ` Eric Blake
2011-01-11 19:58 ` Jilles Tjoelker
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=4D2C8B2C.3060001@phat.za.net \
--to=aragon@phat.za.net \
--cc=dash@vger.kernel.org \
--cc=eblake@redhat.com \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.