> From: [EMAIL PROTECTED] (Peter Seebach)
> Date: Sat 2 Jun, 2001
> Subject: Re: Fixing documented bug in env(1)

> people use --
> to end subsequences of arguments all the time.

No, they use ``--'' to indicate to getopt(3) the end of the _options_ and
the _start_ of the arguments.

Since env(1) uses getopt(3), ``--'' already has meaning to env(1); it allows
environment variables and commands which start with ``-'' (the former is
obviously invalid).

    $ env -i -- -t args

currently allows execution of command ``-t''.

However, what Dima proposes doesn't seem to be harmful, just slightly
confusing, and less surprising than inventing a new delimieter such as
``==''.

    $ env -i -- foo=bar -- 4=4 args

has two distinct uses of `--'' as per Dima's proposal, the first tells
getopt(3) to stop processing options, and the second tells the argument
processing code to stop looking for variable assignments (i.e. ``4=4''
is a command).

                Cheers,

                Mark.

-- 
Mark Valentine, Thuvia Labs <[EMAIL PROTECTED]>       <http://www.thuvia.co.uk>
"Tigers will do ANYTHING for a tuna fish sandwich."       Mark Valentine uses
"We're kind of stupid that way."   *munch* *munch*        and endorses FreeBSD
  -- <http://www.calvinandhobbes.com>                  <http://www.freebsd.org>

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to