darkrc/bin/scratch
DarkWiiPlayer 7824cbd7d1 Improve scratch script
It now execs bash, so the process chain doesn't get needlessly long with
nested calls to the script.
2018-11-29 08:54:00 +01:00

9 lines
239 B
Bash
Executable file

#!/bin/bash
export scratch=$(mktemp -d -t tmp.XXXXXXXXXX)
function finish {
echo "Deleting $scratch..."
rm -rf "$scratch"
}
trap finish EXIT
trap finish TERM
exec bash --init-file <(echo "source ~/.bashrc; pushd $scratch > /dev/null")