aboutsummaryrefslogtreecommitdiff
path: root/pdksh/pdkshrc.d/scr.pdksh
blob: 01bd20cbcd1b641f12de48d020bfb7f1caf7567e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
# 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() {
    if (($# <= 1)) ; then
        cd -- "$(mktd "${1:-scr}")"
    else
        printf 'ksh: scr: too many arguments\n' >&2
        return 2
    fi
}