#!/bin/bash # Run a shell script with a temporary environment in the form of a # temp dir. The directory will be cleaned up after the script # returns. This behaves as dynamic-wind. export TMPDIR=`mktemp -d /tmp/fw.$$.XXXXXXXX` "$@" # echo "cleaning up $TMPDIR" ; ls -l $TMPDIR rm -rf $TMPDIR