Re: setvar MIA?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux