File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -3200,10 +3200,18 @@ function mkcd () {
32003200
32013201# f5# Create temporary directory and \kbd{cd} to it
32023202function cdt () {
3203- local -a cdttemplate
3204- [ " $# " -eq 1 ] && cdttemplate=(-t " $1 " .XXXXXXX)
3205- builtin cd " $( mktemp -d ${cdttemplate[@]} ) "
3206- builtin pwd
3203+ local -a cdttemplate
3204+ if [ " $# " -eq 1 ]; then
3205+ if isfreebsd; then
3206+ # mktemp(1) on FreeBSD doesn't behave the same, cf.
3207+ # https://man.freebsd.org/cgi/man.cgi?query=mktemp#OPTIONS
3208+ cdttemplate=(-t " $1 " )
3209+ else
3210+ cdttemplate=(-t " $1 " .XXXXXXX)
3211+ fi
3212+ fi
3213+ builtin cd " $( mktemp -d ${cdttemplate[@]} ) "
3214+ builtin pwd
32073215}
32083216
32093217# f5# List files which have been accessed within the last {\it n} days, {\it n} defaults to 1
You can’t perform that action at this time.
0 commit comments