Skip to content

Conversation

@moviuro
Copy link
Contributor

@moviuro moviuro commented Jul 3, 2025

While there, fix whitespace

--

root@fbsd ~ # which cdt
cdt () {
        local -a cdttemplate
        if [ "$#" -eq 1 ]
        then
                if isfreebsd
                then
                        cdttemplate=(-t "$1") 
                else
                        cdttemplate=(-t "$1".XXXXXXX) 
                fi
        fi
        builtin cd "$(mktemp -d ${cdttemplate[@]})"
        builtin pwd
}
root@fbsd ~ # cdt grml
/tmp/grml.YFIkcJQw71
root@fbsd /tmp/grml.YFIkcJQw71 # uname -a
FreeBSD fbsd.local 14.2-RELEASE-p1 FreeBSD 14.2-RELEASE-p1 GENERIC amd64

Improves #203

@zeha
Copy link
Member

zeha commented Jul 3, 2025

Could I ask you explain the FreeBSD behaviour? From just the manual page link I don't understand what the difference is between coreutils mktemp and freebsd mktemp.

@zeha
Copy link
Member

zeha commented Jul 3, 2025

okay, i got myself a freebsd VM.

the problem is:

root@freebsd:~ # mktemp -d -t test.XXXXXX
/tmp/test.XXXXXX.Z0aj1NfauX

where with coreutils:

% mktemp -d -t test.XXXXXX
/tmp/test.Wi46it

what an annoying difference. should probably still put some details into the comment

Copy link
Member

@mika mika left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, TIL. LGTM, though I'm a huge fan of having details like "what's broken/why this change/..." in the commit message! :) (Please consider this a nitpick from my side only :))

@mika mika merged commit 6e9f66f into grml:master Aug 15, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants