[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: time builtin handles backgrounding poorly

From: Jan Schampera
Subject: Re: time builtin handles backgrounding poorly
Date: Wed, 12 Sep 2007 21:14:00 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20070505 Iceape/1.0.9 (Debian-1.0.10~pre070720-0etch3)

Jack Lloyd wrote:


        The time builtin seems to be confused if something is
        backgrounded, and prints immediately the time rather than
        waiting for the job to complete. I found this very unexpected.


$ time sleep 5
# hit C-Z to stop the job before 5 seconds

[1]+  Stopped                 sleep 5

real    0m0.525s
user    0m0.000s
sys     0m0.000s
$ fg
sleep 5
# the 5 second sleep continues

I guess that's due to the fact that `time' is not a builtin command, but belongs to the syntax of a pipeline (as in grammar defs).

Though I know where it comes from, I don't know if that behaviour can be changed somehow, I'm not that familiar with the Bash itself.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]