On Fri, Feb 06, 2015 at 04:31:34PM -0800, Andy Zhou wrote: > Executing clean-up commands in the reverse order of their addition > seems to be better for most of the cleanup situations. For example, > in kmod tests, we should remove name spaces before remove kernel > modules. > > Signed-off-by: Andy Zhou <az...@nicira.com>
Not a bad idea! > -m4_define([ON_EXIT], [trap '. ./cleanup' 0; cat >>cleanup <<'EOF' > -$1 > -EOF > +dnl The commands will be added will be tht first one to excute. > +m4_define([ON_EXIT], [trap '. ./cleanup' 0; (echo '$1'; cat cleanup) > > __cleanup; mv __cleanup cleanup > ]) I'm nervous about abandoning the <<'EOF'. Any argument that contains a single-quote will now cause problems. How about (untested): cat - cleanup <<'EOF' >__cleanup $1 EOF mv __cleanup cleanup instead? Acked-by: Ben Pfaff <b...@nicira.com> _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev