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

d-l error handling

I just realized the reason for d-l poor error handling:

trap "test -f ${FILE} && rm -f ${FILE}; exit 0" 0 1 2 3 9 15

This exit 0 happens in the helper helper so callers don't notice the

My naive though is that the trap should be:
trap 'ret=$?; '"rm -f \"${FILE}\";"' exit $ret' EXIT

IIRC this works around broken shells or ambiguity about the return
value of the shell process after ret (is it the value of $? on
entering the trap, or after running the trap commands?)


Reply to: