Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14708 > unrolled thread

Re: Command not found with builtins and variables

Started byChet Ramey <chet.ramey@case.edu>
First post2018-10-10 11:23 -0400
Last post2018-10-10 11:23 -0400
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Command not found with builtins and variables Chet Ramey <chet.ramey@case.edu> - 2018-10-10 11:23 -0400

#14708 — Re: Command not found with builtins and variables

FromChet Ramey <chet.ramey@case.edu>
Date2018-10-10 11:23 -0400
SubjectRe: Command not found with builtins and variables
Message-ID<mailman.1960.1539185023.1284.bug-bash@gnu.org>
On 10/10/18 7:42 AM, bugs@feusi.co wrote:
> Hi,
> I'm not exactly sure if the following is actually a bug or whether bash
> is actually supposed to behave like this. However, I couldn't find any
> documentation concerning it so I decided to ask.
> 
> The thing I noticed is that when setting a variable and then running the
> command "time", bash reports "command not found". For example, the
> command:
> 
> TEST=1 time ls
> 
> Results in "bash: time: command not found"

You don't have a command named `time' in a directory in your $PATH.
Bash doesn't have a `time' builtin; it has a `time' reserved word.
Preceding `time' with a variable assignment removes its special meaning
and causes it to not be recognized as a reserved word.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web