Hacker News new | ask | show | jobs
by slipo 3562 days ago
Pre 4.4 - ';' (command separator) was ignored by time

  # time; echo hola
  -bash: syntax error near unexpected token `echo'
1 comments

Why would you want to time nothing? What does it output, real 0s user 0s system 0s?
Why 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;"?
It 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.
Not always the case, I just tried and:

$ time

real 0m0.002s user 0m0.000s sys 0m0.000s