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

job control from script



Hi all. I wrote a little script, but I cannot to learn him to kill all his childs on SIGINT.
#script:
#!/bin/zsh
setopt MONITOR
function TRAPINT () {
    kill %
    return (( $1+128 ))
}
if [[ $1 == "start" ]]; then
    for (( i=0; i<$2; i++ )); do
        $0 dowork
    done
fi
# ... some long time stuff ...

#----end script

Why `kill %' doesn't work? And `kill %NUM'? And how can I fetch job list for use in script?



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