News for hackers. Stuff that matters.
Re:/usr/bin/time: not the command you think you know by graton on Tuesday March 07, 2017 @12:11AM (#13808414)
On bash you can do this to have it not use an alias or built-in command:

  $ \time echo

  0.00user 0.00system 0:00.00elapsed 100%CPU (0avgtext+0avgdata 1764maxresident)k
  0inputs+0outputs (0major+66minor)pagefaults 0swaps
The built-in version:

  $ time echo


  real    0m0.000s
  user    0m0.000s
  sys     0m0.000s
Re:/usr/bin/time: not the command you think you know by yrro on Tuesday March 07, 2017 @05:49AM (#13809503)
Is this behaviour documented anywhere? The closest I can find is https://www.gnu.org/software/bash/manual/bashref.html#Aliase... which remarks,

> The first word of each simple command, if unquoted, is checked to see if it has an alias.

I observe that t\ime works just as well as \time.

Re:/usr/bin/time: not the command you think you know by ptx on Tuesday March 07, 2017 @06:55AM (#13809729)
Just quoting it normally also works, apparently, as your excerpt from the man page suggests:

  $ help|head -1
  GNU bash, version 4.3.30(1)-release (x86_64-pc-linux-gnu)
  $ "time" --version
  GNU time 1.7
  $ time --version
  bash: --version: command not found
  
  real	0m0.001s
  user	0m0.000s
  sys	0m0.000s
Re:/usr/bin/time: not the command you think you know by sigjuice on Tuesday March 07, 2017 @10:31AM (#13811048)
t\ime is rather surprising. Is there any documentation or explanation on why it does what it does?
Re:/usr/bin/time: not the command you think you know by yrro on Tuesday March 07, 2017 @06:42PM (#13816381)
https://www.gnu.org/software/bash/manual/bashref.html#Escape...

I think it's because using the backslash to escape counts as quoting. So the following are all equivalent:

  $ \time foo
  $ t\ime foo
  $ 'time' foo
Re:/usr/bin/time: not the command you think you know by bobbyi_settv on Tuesday March 07, 2017 @11:08AM (#13811485)
The conventional way of forcing bash not to use a built-in is by using the full path (/usr/bin/time in this case).
Re:/usr/bin/time: not the command you think you know by eridius on Tuesday March 07, 2017 @04:52PM (#13815342)
The more obvious way of doing this is

  command time echo
The usage of the `command` keyword makes it ignore shell functions (including built-in shell keywords like time).