Fix scratch bash script
This commit is contained in:
parent
89a191969f
commit
fee1f0601a
1 changed files with 5 additions and 3 deletions
|
@ -1,9 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
export scratch=$(mktemp -p /dev/shm -d -t tmp.XXXXXXXXXX)
|
export scratch=$(mktemp -p /dev/shm -d -t tmp.XXXXXXXXXX)
|
||||||
|
|
||||||
function finish {
|
function finish {
|
||||||
echo "Deleting $scratch..."
|
|
||||||
rm -rf "$scratch"
|
rm -rf "$scratch"
|
||||||
}
|
}
|
||||||
|
|
||||||
trap finish EXIT
|
trap finish EXIT
|
||||||
trap finish TERM
|
trap finish SIGTERM
|
||||||
exec bash --init-file <(echo "source ~/.bashrc; pushd $scratch > /dev/null")
|
|
||||||
|
bash --init-file <(echo "source ~/.bashrc; pushd $scratch > /dev/null")
|
||||||
|
|
Loading…
Reference in a new issue