bug-bash
[Top][All Lists]
Advanced

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

Re: while sleep 1;do :& done vs. C-z


From: Chet Ramey
Subject: Re: while sleep 1;do :& done vs. C-z
Date: Mon, 25 Oct 2004 09:51:03 -0400

> Chet> I suspect that chances are pretty good you're stopping the
> Chet> `sleep 1' process in the first example, which causes it to return
> Chet> to the calling shell with a non-zero exit status
> 
> By the way, odd, hitting C-z during
> $ sleep 8 && echo OK
> always gets OK... meaning that suspending something always causes it
> look like it completed successfully... well, I guess I've got a lot to
> learn.  Anyways, I'm not sure one is able to make sleep return failure
> with just C-z.

You're right about that, but SIGTSTP causes loops to be broken internally,
with the equivalent of returning a non-zero exit status.  Since the loop
isn't really an individual job from the job control perspective, there's
not much you can otherwise do.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live...Laugh...Love
Chet Ramey, ITS, CWRU    chet@po.cwru.edu    http://tiswww.tis.cwru.edu/~chet/




reply via email to

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