« Using OpenAI's ChatGPT API, iTerm2 can now write commands for you, interpret the output of commands, and guide you towards a goal. See the AI section below for details. » iTerm…

how much you wanna bet ChatGPT is trained on GNU utilities and the things it suggest do something entirely different on BSD‐based platforms like macOS

“chatgpt how to get the last modified time of a file using only posix commandline utilities”

if you were wondering, apparently the answer is

if test ! -f build/.mtime; then printf '%b' '\n' > build/.mtime; fi; touch -r "$FILE" build/.mtime; TZ=UTC0 diff -u build/.mtime /dev/null | sed '1!d;s/.*\t\([^ ]\) \([^ ]\).*/\1T\2Z/'

(replacing \t with a tab character)

BUT this requires version 7 of POSIX

BUT it should still work in e·g Macintosh even tho they’re not strictly conformant

Follow

(funnily, Macintosh is conformant in legacy mode)

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.