Re:/usr/bin/time: not the command you think you know
by halostatue on Monday March 06, 2017 @11:07PM
(#13808192)
In both bash and zsh, you can force the shell to use $PATH for lookup (bypassing functions and shell builtins) by calling a builtin name with 'command' ('command time -l ls'). You can equivalently force a builtin with 'builtin', but that does not work with reserved words (and 'time' is a shell reserved word).
[ Parent
| on HN ]
Re:/usr/bin/time: not the command you think you know
by ramshorns on Tuesday March 07, 2017 @02:01AM
(#13808772)
TIL that a shell reserved word is different from a shell builtin.
http://unix.stackexchange.com/questions/267761/differences-b...
Re:/usr/bin/time: not the command you think you know
by xelxebar on Tuesday March 07, 2017 @10:07PM
(#13817535)
Yeah. Shell semantics can be pretty unintuitive sometimes. I often find it helpful to translate these ideas to standard programming language terms.
* Commands are like functions * Commands in /bin etc. are like library functions * Builtins are like a language's primitive functions * Keywords are keywords
Re:/usr/bin/time: not the command you think you know
by halostatue on Tuesday March 07, 2017 @11:05AM
(#13811437)
Me, too. I was surprised because I was trying to use `builtin time`. :)
Re:/usr/bin/time: not the command you think you know
by LeoPanthera on Tuesday March 07, 2017 @12:26PM
(#13812419)
You can also just prefix the command with a backslash. "\time" will run the version in the path.