4 ms·
Pre 4.4 - ';' (command separator) was ignored by time # time; echo hola -bash: syntax error near unexpected token `echo'
by slipo 10y ago
Pre 4.4 - ';' (command separator) was ignored by time
# time; echo hola
-bash: syntax error near unexpected token `echo'
- etatoby 10y agoWhy would you want to time nothing? What does it output, real 0s user 0s system 0s?
- thiagoharry 10y agoWhy would you want to multiply by 1 or sum zero? You probably wouldn't need to do it, but computers and scripts aren't so smart as people and always follow code literally. For them is important a language having less irregularities and exceptional rules. If "" is a valid command and you have the syntax "time [COMMAND];", why not allow "time;"?
- sillysaurus3 10y agoIt might be to avoid errors for scripts like: time ${cmd}; foo where cmd happens to be unset. Conceptually, that's a valid script, because `time` standalone is a valid script. No reason it should generate an error.
- fosk 10y agoNot always the case, I just tried and: $ time real 0m0.002s user 0m0.000s sys 0m0.000s