DarkWiiPlayer
6a8d978bfd
This script creates a new temporary folder and starts a bash shell in it. After the shell exits, the directory is deleted.
9 lines
234 B
Bash
Executable file
9 lines
234 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
|
|
bash --init-file <(echo "source ~/.bashrc; pushd $scratch > /dev/null")
|