Comment

Comment by chenxiaolong

This should work with any arbitrary filename:

    latest=$(printf '%s\0' <glob> | sort -zrV | head -zn1)
or with long args:

    latest=$(printf '%s\0' <glob> | sort --zero-terminated --reverse --version-sort | head --zero-terminated --lines 1

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton