[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Reserved words and the type builtin
From: |
Glenn Morris |
Subject: |
Reserved words and the type builtin |
Date: |
Thu, 17 Jul 2003 01:39:34 +0100 |
User-agent: |
Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) |
[ I originally tried to post this direct to the gnu.bash.bug
newsgroup, but that seems to be dead. I apologize if you get this
twice. ]
Bash 2.05b, Red Hat 7.3.
The `type' builtin checks arguments in the order:
alias, keyword, function, builtin, file
But it seems as if command parsing uses the order:
keyword, alias, function, builtin
This seems inconsistent and confusing to me, eg:
bash> alias time='echo "this is an alias"'
bash> type time
time is aliased to `echo "this is an alias"'
bash> time ls
real 0m0.010s
user 0m0.000s
sys 0m0.010s
On a slightly related, "philosophical" issue, why is time a reserved
word rather than a builtin? I'd prefer to use GNU /usr/bin/time, but
it seems there is no way (?) for me to disable the interpretation of
time as a bash reserved word (other than using \time on every
occasion, or compiling bash with --disable-command-timing).
Thanks in advance.
- Reserved words and the type builtin,
Glenn Morris <=