[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: style of assignment to variable changes command selection

From: Eric Blake
Subject: Re: style of assignment to variable changes command selection
Date: Fri, 07 Mar 2008 22:27:16 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20080213 Thunderbird/ Mnenhy/

Hash: SHA1

Re-adding the list - I am not the bash maintainer, so keeping the list in
the loop is essential if you want any action taken.

According to Doug McIlroy on 3/7/2008 9:12 PM:
| Thank you for the prompt reply
|> The difference in behavior is because this is the implementation that bash
|> chose - unlike all other bash builtins (which are not reserved words),
|> time is recognized as the bash version ONLY if it is the first word of a
|> simple command; using a variable assignment bypasses the reserved word
|> recognition and defers to the binary application.
| So there's a bug in the manual, which does not breathe a word about
| time being executed by the shell.  And the shell covers its tracks, too:

Like I said, there's a difference between a builtin (for example,
'builtin' or 'exec') and a reserved word (for example, 'time' or 'if').

|         % builtin time
|         bash: builtin: time: not a shell builtin
| Were I still the keeper of Unix manuals, my fix to the manual
| would be to list this wart under BUGS.

'man bash' correctly lists time under the section RESERVED WORDS.  Also,
'help time' gives evidence that it is special to bash (as 'help' is the
bash builtin that reports about both reserved words and builtins).

| Doug McIlroy
| (Editor of Unix manuals, editions 7-10)

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


reply via email to

[Prev in Thread] Current Thread [Next in Thread]