aboutsummaryrefslogtreecommitdiff
path: root/sh/shrc.d/scr.sh
blob: 19367ffc0dcf9e58487aab72a99a011741ad15ab (plain) (blame)
1
2
3
4
5
6
7
# Create a temporary directory and change into it, to stop me putting stray
# files into $HOME, and making the system do cleanup for me.  Single optional
# argument is the string to use for naming the directory; defaults to "scr".
scr() {
    # shellcheck disable=SC2164
    cd -- "$(mktd "${1:-scr}")"
}