3 ms·
Is this behaviour documented anywhere? The closest I can find is https://www.gnu.org/software/bash/manual/bashref.html#Aliases https://www.gnu.org/software/bash
by yrro 10y ago
Is this behaviour documented anywhere? The closest I can find is https://www.gnu.org/software/bash/manual/bashref.html#Aliases 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.
- ptx 10y agoJust 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
- sigjuice 10y agot\ime is rather surprising. Is there any documentation or explanation on why it does what it does?
- yrro 10y agohttps://www.gnu.org/software/bash/manual/bashref.html#Escape-Character 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