From owner-freebsd-hackers@FreeBSD.ORG Sat Nov 1 04:03:49 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9D4E716A4CE for ; Sat, 1 Nov 2003 04:03:49 -0800 (PST) Received: from pc5.i.0x5.de (sam.staff.webport.de [217.145.105.103]) by mx1.FreeBSD.org (Postfix) with ESMTP id 619C443FA3 for ; Sat, 1 Nov 2003 04:03:47 -0800 (PST) (envelope-from nicolas@dauerreden.de) Received: from pc5.i.0x5.de (localhost [127.0.0.1]) by pc5.i.0x5.de (8.12.8p2/8.12.8) with ESMTP id hA1C3jPA077358 for ; Sat, 1 Nov 2003 13:03:45 +0100 (CET) (envelope-from nicolas@pc5.i.0x5.de) Received: (from nicolas@localhost) by pc5.i.0x5.de (8.12.8p2/8.12.8/Submit) id hA1Bpw1E058027 for freebsd-hackers@freebsd.org; Sat, 1 Nov 2003 12:51:58 +0100 (CET) Date: Sat, 1 Nov 2003 12:51:58 +0100 From: Nicolas Rachinsky To: freebsd-hackers@freebsd.org Message-ID: <20031101115158.GA48033@pc5.i.0x5.de> Mail-Followup-To: freebsd-hackers@freebsd.org References: <20031031014331.A71967@xorpc.icir.org> <200310312016.h9VKGv8X006950@lurza.secnetix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200310312016.h9VKGv8X006950@lurza.secnetix.de> X-Powered-by: FreeBSD X-Homepage: http://www.rachinsky.de X-PGP-Keyid: C11ABC0E X-PGP-Fingerprint: 19DB 8392 8FE0 814A 7362 EEBD A53B 526A C11A BC0E X-PGP-Key: http://www.rachinsky.de/nicolas/nicolas_rachinsky.asc X-SECURITY: Never trust a running system User-Agent: Mutt/1.5.4i Subject: Re: RFC: proposed new builtin for /bin/sh (associative arrays) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2003 12:03:49 -0000 * Oliver Fromme [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