darkrc/bin/scratch

12 lines
222 B
Plaintext
Raw Normal View History

#!/bin/bash
export scratch=$(mktemp -p /dev/shm -d -t tmp.XXXXXXXXXX)
2019-09-18 12:31:20 +00:00
function finish {
rm -rf "$scratch"
}
2019-09-18 12:31:20 +00:00
trap finish EXIT
2019-09-18 12:31:20 +00:00
trap finish SIGTERM
bash --init-file <(echo "source ~/.bashrc; pushd $scratch > /dev/null")