From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 31 02:58:28 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 7F77A16A4CE for ; Fri, 31 Oct 2003 02:58:28 -0800 (PST) Received: from gandalf.online.bg (gandalf.online.bg [217.75.128.9]) by mx1.FreeBSD.org (Postfix) with SMTP id 72AD643FBF for ; Fri, 31 Oct 2003 02:58:26 -0800 (PST) (envelope-from roam@ringlet.net) Received: (qmail 12148 invoked from network); 31 Oct 2003 10:57:30 -0000 Received: from office.sbnd.net (HELO straylight.ringlet.net) (217.75.140.130) by gandalf.online.bg with SMTP; 31 Oct 2003 10:57:30 -0000 Received: (qmail 5431 invoked by uid 1000); 31 Oct 2003 10:58:23 -0000 Date: Fri, 31 Oct 2003 12:58:23 +0200 From: Peter Pentchev To: Luigi Rizzo Message-ID: <20031031105823.GF569@straylight.oblivion.bg> Mail-Followup-To: Luigi Rizzo , hackers@freebsd.org References: <20031031014331.A71967@xorpc.icir.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vv4Sf/kQfcwinyKX" Content-Disposition: inline In-Reply-To: <20031031014331.A71967@xorpc.icir.org> User-Agent: Mutt/1.5.4i cc: hackers@freebsd.org 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: Fri, 31 Oct 2003 10:58:28 -0000 --vv4Sf/kQfcwinyKX Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 31, 2003 at 01:43:31AM -0800, Luigi Rizzo wrote: [snip description of a new 'indexes' builtin] > Any comments ? Is this interesting enough to be committed > (with a proper manpage description) ? > I could provide a flag to "indexes" to return the values instead > of the names, but i believe this form is more useful. Just a minor suggestion: could this be done as another form of variable expansion instead of as another keyword? Rationale: bash already does this - from the 'EXPANSION' section of its manpage: ${!prefix*} Expands to the names of variables whose names begin with prefix, separated by the first character of the IFS special variable. Thus, 'indexes foo_' would be equivalent to '${!foo_*}'. What you've done is great - several times I've found myself wishing that our sh had this, especially after finding that bash does it - but wouldn't it be better not to introduce a gratuitious syntax incompatibility if we can help it? :) G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@sbnd.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 If this sentence were in Chinese, it would say something else. --vv4Sf/kQfcwinyKX Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/okBP7Ri2jRYZRVMRAlSlAKCFaaHpWgp4GDuTDONOqk6UHAq2ZgCfZz7U bRXJBQ33zAX86tk1bw60fBM= =eWCx -----END PGP SIGNATURE----- --vv4Sf/kQfcwinyKX--