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 @@ -3201,10 +3201,18 @@ function mkcd () {
32013201
32023202# f5# Create temporary directory and \kbd{cd} to it
32033203function cdt () {
3204- local -a cdttemplate
3205- [ " $# " -eq 1 ] && cdttemplate=(-t " $1 " .XXXXXXX)
3206- builtin cd " $( mktemp -d ${cdttemplate[@]} ) "
3207- builtin pwd
3204+ local -a cdttemplate
3205+ if [ " $# " -eq 1 ]; then
3206+ if isfreebsd; then
3207+ # mktemp(1) on FreeBSD doesn't behave the same, cf.
3208+ # https://man.freebsd.org/cgi/man.cgi?query=mktemp#OPTIONS
3209+ cdttemplate=(-t " $1 " )
3210+ else
3211+ cdttemplate=(-t " $1 " .XXXXXXX)
3212+ fi
3213+ fi
3214+ builtin cd " $( mktemp -d ${cdttemplate[@]} ) "
3215+ builtin pwd
32083216}
32093217
32103218# 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