dash and build-in time command: not expected behavior
stefan at schweter.it
Wed Jun 18 15:55:03 UTC 2014
I'm currently found out some "strange" behavior with the built-in time
command in combination with dash:
$ time echo "test" | wc -l | sleep 5
0.00user 0.00system 0:00.00elapsed ?%CPU (0avgtext+0avgdata
0inputs+0outputs (0major+200minor)pagefaults 0swaps
I expected that the time command measure the time for the whole pipe
construct - but in this case I guess it finishes after the echo command.
Same command in a bash returns:
time echo "test" | wc -l | sleep 5
How can I achieve the time command in dash to measure the time for the
whole pipe process?
Thanks many in advance,
More information about the ubuntu-users