Skip to content

Instantly share code, notes, and snippets.

@larsyencken
Created April 2, 2014 00:15
Show Gist options
  • Save larsyencken/9925707 to your computer and use it in GitHub Desktop.
Save larsyencken/9925707 to your computer and use it in GitHub Desktop.
Make and enter a temporary scratch directory
#!/bin/bash
#
# tempdir
#
# Enter a temporary scratch space directory.
#
d="$(mktemp -d)"
(
echo "Entering $d"
cd "$d"
zsh
)
echo "Cleaning up $d"
rm -rf "$d"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment