Re: svn commit: r207206 - head/bin/sh

[ Available lists | Index of svn-src-all | Month of Apr 2010 | Week of 28 Apr 2010 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Ed Maste <emaste@freebsd.org>
Date
28 Apr 2010 15:37:00
Subject
Re: svn commit: r207206 - head/bin/sh
Message-ID
20100428153659.GA42914@sandvine.com


[ Hide this part ]
On Tue, Apr 27, 2010 at 07:52:25AM +0400, Andrey Chernov wrote:

> Just wonder, do you have plans to implement ${!variable} sometimes?
> This bashism is very useful:
...

While we're on this topic, I'll mention the bashism I'd like to see
support for -- array variables.

Older versions supported only one-dimensional numeric indicies.
http://tldp.org/LDP/abs/html/arrays.html

foo[1]=abc
foo[2]=def
echo ${foo[1]} ${foo[2]}


Bash 4 adds associative arrays.

foo[bar]=ghi
foo[baz]=jkl

echo ${foo[bar]} ${foo[baz]}
echo ${foo[*]}

-Ed


Elapsed time: 0.253 seconds