Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: job control from script



On Dec 11, 11:34pm, rgo wrote:
}
} > 	jobs -p | while read jnum jpid text; do kill $jpid; done
} 
} zsh-4.2.5 [...] but pipe doesn't work.

Hmm, yes, there's definitely a bug.  Running "jobs" in a subshell of a non-
interactive shell hangs forever, almost as if "wait" had been executed,
even if MONITOR is set.

} > 	setopt MONITOR HUP
} > 	function TRAPINT() { kill -HUP $$ }
} 
} This is really work :). But gives a warning.

Change it to

	function TRAPINT() { exec 2>/dev/null; kill -HUP $$ }

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author