3 ms·
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' ('comman
by halostatue 10y ago
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).
- ramshorns 10y agoTIL that a shell reserved word is different from a shell builtin. http://unix.stackexchange.com/questions/267761/differences-between-keyword-reserved-word-and-builtin http://unix.stackexchange.com/questions/267761/differences-b...
- halostatue 10y agoMe, too. I was surprised because I was trying to use `builtin time`. :)
- xelxebar 10y agoYeah. 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
- LeoPanthera 10y agoYou can also just prefix the command with a backslash. "\time" will run the version in the path.