From owner-freebsd-hackers Sun Jun 3 16:53: 2 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from phaidor.thuvia.org (thuvia.demon.co.uk [193.237.34.248]) by hub.freebsd.org (Postfix) with ESMTP id E66F737B405 for ; Sun, 3 Jun 2001 16:52:55 -0700 (PDT) (envelope-from mark@thuvia.demon.co.uk) Received: from dotar-sojat.thuvia.org (dotar-sojat.thuvia.org [10.0.0.4]) by phaidor.thuvia.org (8.11.3/8.11.3) with ESMTP id f53Nque16910; Mon, 4 Jun 2001 00:52:56 +0100 (BST) (envelope-from mark@dotar-sojat.thuvia.org) Received: (from mark@localhost) by dotar-sojat.thuvia.org (8.11.3/8.11.3) id f53Nqvn47341; Mon, 4 Jun 2001 00:52:57 +0100 (BST) (envelope-from mark) Date: Mon, 4 Jun 2001 00:52:57 +0100 (BST) From: Mark Valentine Message-Id: <200106032352.f53Nqvn47341@dotar-sojat.thuvia.org> In-Reply-To: Peter Seebach's message of Jun 3, 10:46pm X-Mailer: Mail User's Shell (7.2.6 beta(5) 10/07/98) To: seebs@plethora.net (Peter Seebach), hackers@freebsd.org Subject: Re: Fixing documented bug in env(1) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > From: seebs@plethora.net (Peter Seebach) > Date: Sun 3 Jun, 2001 > Subject: Re: Fixing documented bug in env(1) > >> However, what Dima proposes doesn't seem to be harmful, just slightly > >> confusing, and less surprising than inventing a new delimieter such as > >> ``==''. > > == is very confusing, and it's not the way anything else has ever done > delimiters. "--" already means "change the way you process words". It's > only marginally surprising to use it for another change. Yes, I was (sort of) supporting ``--'' as an "end of assignment" delimiter here; however, one more compatibility issue throws a spanner in the works... Both ``--'' and ``=='' are valid commands, and currently only the former is handled by env(1): $ env foo=bar -- args executes the command ``--''. Dima's proposal would require this to change: $ env foo=bar -- -- args David's proposal would not break this, and would allow $ env foo=bar == == args to execute the command ``==''. David's proposal only seems to break even more obscure (erroneous?) stuff like: $ env foo=bar == bar=foo command args (Tell me that no script anywhere relies on this long-standing behaviour!) Actually I don't like either solution much (if the documented bug were this easy to fix, it would have been fixed decades ago...). Commands starting with ``-'' already cause grief (e.g. in make(1)), and commands with ``='' in their names almost certainly break in all sorts of other contexts (e.g. when used unquoted in a Bourne shell). (Do any shells still treat ``foo=bar'' as an assigment anywhere on the command line?) I'd leave the "bug" alone, pending real enlightenment... By the way, who uses env(1) anyway? In the past twenty years, I've only ever used it as shorthand for printenv(1). What's this csh(1) thing? :-) Hmm, would a new csh(1) builtin help any? /bin/sh: $ foo=bar bar=foo echo hello hello $ foo=bar 'bar=foo' echo hello bar=foo: not found /bin/csh: % env foo=bar bar=foo echo hello hello % env foo=bar 'bar=foo' echo hello hello % withenv foo=bar 'bar=foo' echo hello # new withenv(1) builtin bar=foo: not found (I'm not up on csh(1)'s foibles sufficiently to tell whether this would be a done thing, but its syntax already seems fairly, erm, what's the polite word?) Cheers, Mark. -- Mark Valentine, Thuvia Labs "Tigers will do ANYTHING for a tuna fish sandwich." Mark Valentine uses "We're kind of stupid that way." *munch* *munch* and endorses FreeBSD -- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message