From: Bernhard Voelker <mail@bernhard-voelker.de>
To: "Andreas Löw" <l2w@gmx.de>, 61530@debbugs.gnu.org
Subject: bug#61530: sha256sum check single file in a mutiple sha sum text file
Date: Thu, 16 Feb 2023 00:21:24 +0100 [thread overview]
Message-ID: <d2917b7d-f1b7-e226-2ee7-ebb0280285cf@bernhard-voelker.de> (raw)
In-Reply-To: <trinity-c25dcff4-526e-4fef-adf8-cb1bb1743613-1676467683384@3c-app-gmx-bs58>
tag 61530 notabug
close 61530
stop
On 2/15/23 14:28, Andreas Löw wrote:
> Hello,
>
> I want to check a single file for correct sha256. All the files of my
> directory are included in a sha256 text file named allsha256.
>
> The sha256sum always checks all files included in the allsha256 file,
> even if I write:
>
> sha256sum myfile -c allsha256
>
> It reports a warning 'no correct formatted line was found for myfile'
> and later it reports 'myfile OK'
>
> Regards,
> Andreas
The *sum utilities always check all files given in a checksum file(s).
That means once you've passed the -c option, the utility will treat all
further arguments as the name of files with checksums - no matter if the
file appears before or after the -c option:
$ sha256sum README NEWS > checksum1
$ sha256sum TODO configure > checksum2
$ sha256sum checksum1 -c checksum2
README: OK
NEWS: OK
TODO: OK
configure: OK
To achieve what you want, you have to pass only the checksum line of the
file you want, e.g.:
$ grep myfile allsha256s | sha256sum -c -
myfile: OK
Therefore, I'm hereby marking this as not-a-bug in our bug tracker.
Have a nice day,
Berny
prev parent reply other threads:[~2023-02-15 23:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-15 13:28 bug#61530: sha256sum check single file in a mutiple sha sum text file Andreas Löw
2023-02-15 23:21 ` Bernhard Voelker [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.gnu.org/mailman/listinfo/bug-coreutils
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d2917b7d-f1b7-e226-2ee7-ebb0280285cf@bernhard-voelker.de \
--to=mail@bernhard-voelker.de \
--cc=61530@debbugs.gnu.org \
--cc=l2w@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).