On 2020-07-19 12:00, Jeffrey Walton wrote:
> Related, b2sum (also provided by coreutils), offers the option. But
> you have to specify --tag to get just the hash. And I don't believe
> coreutils supports the option.
Not quite: coreutils' b2sum supports --tag (like the other *sum utilities),
but still outputs - also - the file name:
$ b2sum --help | grep tag
--tag create a BSD-style checksum
$ b2sum --tag /proc/cpuinfo
BLAKE2b (/proc/cpuinfo) =
7a8f21bd21de088af5cf29ac21eea21f2b7c21e893b300cf001d6c8a18ddf9d93ef4b46fb1befc4[...]
$ sha256sum --tag /proc/cpuinfo
SHA256 (/proc/cpuinfo) =
2f6134c08218d4ca1fe9c4d711762e8a0a8cd83631ceae26c698a7560367a04b
So --tag was introduced for compatibility with an existing implementation.
Have a nice day,
Berny