Date: Sat, 1 Nov 2003 12:51:58 +0100 From: Nicolas Rachinsky <list@rachinsky.de> To: freebsd-hackers@freebsd.org Subject: Re: RFC: proposed new builtin for /bin/sh (associative arrays) Message-ID: <20031101115158.GA48033@pc5.i.0x5.de> In-Reply-To: <200310312016.h9VKGv8X006950@lurza.secnetix.de> References: <20031031014331.A71967@xorpc.icir.org> <200310312016.h9VKGv8X006950@lurza.secnetix.de>
next in thread | previous in thread | raw e-mail | index | archive | help
* Oliver Fromme <olli@lurza.secnetix.de> [2003-10-31 21:16 +0100]: > Maybe I'm not understanding your intentions, but isn't that > already possible using "set | sed -n '/^foo_/s/=.*//p'"? > > Or do you want to avoid external programs? In that case it > would be a little bit more difficult to do, but it's still > possible to do with existing builtins: > > indexes() > { > for i in `set`; do > case $i in > $1*) echo ${i%%=*} > esac > done > } I think both of these could fail with multiline values. Nicolas
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031101115158.GA48033>