Re:/usr/bin/time: not the command you think you know
by dredmorbius on Wednesday March 08, 2017 @06:04PM
(#13824819)
Thanks, that does raise some interesting points.
What of:
/usr/bin/time ( sleep 1 | sleep 10 )
Explicitly invvoking a subshell. Which I understand the builtin to be doing.
time prefixes a pipeline ( the most basic case being a single command without a pipe into another ), a command block { ... } a subshell block ( ... ), a for statement, an if statement, just whatever really.
This "time" would output how long "a" took to run:
This "time" outputs how long the pipeline "a", "d", "f", and "h" took to run: This is a syntax error: This returns how long the command group takes to run: Further examples: Note the two /usr/bin/time's output their timing information as soon as the first command is done, but the pipeline doesn't return until both commands have exited.> hope this rant helps in some way