Hide Forgot
I have a very strange problem. I cannot execute `time' built-in command if the command is resolution of variable expansion: root@fedora-21:~ # cat /tmp/expandedtime #!/bin/bash set -x VARIABLE="time" "$VARIABLE" /bin/true root@fedora-21:~ # /tmp/expandedtime + VARIABLE=time + time /bin/true /tmp/expandedtime: line 4: time: command not found root@fedora-21:~ # time /bin/true real 0m0.006s user 0m0.002s sys 0m0.004s root@fedora-21:~ # type -a time time is a shell keyword root@fedora-21:~ # rpm -qf /bin/bash bash-4.2.45-4.fc20.x86_64 I observe this problem in Fedora 21, and 20. I cannot reproduce it in Fedora 19. However my colleague has similar problem even in Fedora 19. Everything on x86_64. If I replace the `time' for some other built-in, like `help', the bug disappears.
So I can reproduce it even in Fedora 19. If /usr/bin/time (from standalone `time' package) is installed, the script can execute time built-in. If I uninstall the package, it is not possible to execute the built-in.
(In reply to Petr Pisar from comment #1) > So I can reproduce it even in Fedora 19. If /usr/bin/time (from standalone > `time' package) is installed, the script can execute time built-in. If I > uninstall the package, it is not possible to execute the built-in. time is not builtin. The same result is with `while' for example.
I see. So that's the difference between built-in command and keyword.