1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#!/bin/sh if test "$VERBOSE" = yes; then set -x mkdir --version fi pwd=`pwd` tmp=`echo "$0"|sed 's,.*/,,'`.tmp trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0 trap '(exit $?); exit' 1 2 13 15 mkdir --parents $pwd/$tmp || fail=1 test -d $tmp || fail=1 exit $fail