Hacker News new | past | comments | ask | show | jobs | submit login

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).



TIL that a shell reserved word is different from a shell builtin.

http://unix.stackexchange.com/questions/267761/differences-b...


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


Me, too. I was surprised because I was trying to use `builtin time`. :)


You can also just prefix the command with a backslash. "\time" will run the version in the path.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: