Project

General

Profile

« Previous | Next » 

Revision 13231

lib/sh/util.sh: signals: override catch() to support SIG* as exception type

View differences:

trunk/lib/sh/util.sh
393 393

  
394 394
sig_e() { echo $(( 128+$(kill -l "$1") )); } # usage: sig_e SIGINT, etc.
395 395

  
396
func_override catch__exceptions
397
catch() # supports SIG* as exception type
398
{
399
	if starts_with SIG "$1"; then set -- "$(sig_e "$1")"; fi
400
	catch__exceptions "$@"
401
}
402

  
396 403
ignore_sig() { ignore "$(sig_e "$1")"; }
397 404

  
398 405
# usage: piped_cmd cmd1...|cmd2... # cmd2 doesn't read all its input

Also available in: Unified diff