4 ms·
prunef is also good at this tarsnap --list-archives | prunef | xargs tarsnap -d https://git.sr.ht/~apreiml/prunef/ https://git.sr.ht/~apreiml/prunef/
by commotionfever 6y ago
prunef is also good at this
tarsnap --list-archives | prunef | xargs tarsnap -d
https://git.sr.ht/~apreiml/prunef/ https://git.sr.ht/~apreiml/prunef/
- mfontani 6y agoI strongly recommend "--no-run-if-empty" on xargs pipelines like these.
- LukeShu 6y agoIt depends on which OS you're on. GNU xargs: Normally runs the command at least once, but you can turn that off with "-r" or "--no-run-if-empty". OpenBSD xargs: Like GNU, but only has the short "-r" version of the flag. FreeBSD xargs: Never runs the command if the input is empty, has "-r" (but not "--no-run-if-empty") as a no-op compatibility flag for GNU. macOS xargs: Never runs the command if the input is empty (has no "-r" or "--no-run-if-empty" flags).
- kevans91 6y agoI see no reason not to also provide the compatible long option on FreeBSD: https://svnweb.freebsd.org/changeset/base/365954 https://svnweb.freebsd.org/changeset/base/365954