On 12/17/24 06:45, Pádraig Brady wrote:
On 17/12/2024 09:20, wrotycz wrote:
For some time I had in mind option to hash-sum that would only print checksum without filename as it is very useful when using calculated hashes.   As there is no simple way to get rid of it, other than with external command like awk, I decided to add something simple to hash-sum command/s.   I was intending to name it `-1'  but found out that BSD already have[1] exactly that option and use `quiet' (`-q' for short) switch. So I followed suit and utilised already existing `--quiet' option.  Attached short diff/patch for that occasion.   How you find it useful and worth implementing.   Regards --  1.  man.openbsd.org https://man.openbsd.org/md5

Piotr Dabrowski asked this recently, and my response then was:

"Using the --quiet option for this seems a little awkward.
One reason we added the --raw option, was for this single input case.
I.e. please consider using something like this example:"

    cksum --raw -a md5 | basenc --base16

Now the BSDs implementing -q for this does change things a bit,
as we'd be adding compat, albeit without adding functionality.
So given there are two separate suggestions for this and
we're increasing compat, I'm 55:45 for adding this now.

Note FreeBSD at least will output checksums without file name
for all specified files, though that would be an unusual use case.

I'm unsure of which command hash-sum is, but I note that toybox has been using -b (brief) in md5sum through sha3sum for 10 years now:

https://github.com/landley/toybox/commit/2682551a4b19

Which isn't just android, QNX 8 switched to toybox, and I'm happy to poke the busybox guys..

https://www.qnx.com/developers/docs/relnotes8.0/com.qnx.doc.discontinuation_notice/topic/target_side_utilities.html

(And yes I went with -b because "quiet" already had a different meaning.)

I'd probably have poked you guys about -b earlier but it's been 6 months since https://lists.gnu.org/archive/html/coreutils/2024-06/msg00017.html which didn't get a reply, but https://lists.gnu.org/archive/html/coreutils/2023-08/msg00039.html did...

Rob

Reply via email to