Re: bash trap techniques for group-command in a pipeline

2011-05-24 Thread john.ruckstuhl
Solution... this works nicely: # print opening html echo "" # on error, print msg and exit $STATUS trap myERRhandler ERR myERRhandler () { local STATUS=$? printf "Trouble: trapped ERR, exiting %s\n" $STATUS >& 2 exit $STATUS } # on exit, print

bash trap techniques for group-command in a pipeline

2011-04-02 Thread john.ruckstuhl
Summary: I don't see the best way to (in bash) trap/handle an ERR inside a group-command "{}" that is in a pipeline. I have a way that seems to work, see "(F)", but little confidence that it's the best way, and some suspicion that the overall effort is misguided. Detail: I'd like to trap and hand