Jan Engelhardt wrote: > >'trap' commands in shell scripts present a dilemma: > > > > trap "rmdir '$lockdir'; exit 1" 1 2 15 > > we get undefined behaviour if $lockdir contains a single-quote, > > Also worth noting is that $lockdir is/was evaluated at the time of > the trap setup, and your patch changes the evaluation of $lockdir to > the time of trap execution.
True. It is essential that the value of $lockdir is not changed once the 'cleanup' function is defined. Bruno
