> trap 'cd /; rm -rf $work_dir $TEXDIR/texmf/.tmp_testfile.$$;trap '' 0; > exit 0' 0 1 2 15 I have no way to test, but using '' twice seems wrong to me. How about: trap "cd /; rm -rf $work_dir $TEXDIR/texmf/.tmp_testfile.$$;trap '' 0; exit 0" 0 1 2 15