bug-bash
[Top][All Lists]
Advanced

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

Re: [BUG] variable assignments before a command


From: Greg Wooledge
Subject: Re: [BUG] variable assignments before a command
Date: Tue, 30 Sep 2025 07:12:16 -0400
User-agent: Mutt/1.10.1 (2018-07-13)

On Tue, Sep 30, 2025 at 10:58:48 +0200, Pourko via Bug reports for the GNU 
Bourne Again SHell wrote:
> $ FOO=bar time true

When you use this syntax, you're forcing "time" to be evaluated as a
regular command instead of a keyword.

Here's the keyword:

hobbit:~$ time --version
bash: --version: command not found
real 0.002  user 0.000  sys 0.002

Here's the external /usr/bin/time (on Debian 13):

hobbit:~$ /usr/bin/time --version
time (GNU Time) UNKNOWN
...

And here's the syntax you were trying to use:

hobbit:~$ x=y time --version
time (GNU Time) UNKNOWN
...

As you can see, it uses the external /usr/bin/time.



reply via email to

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