You need a lot more than an if statement to do what you want to do. And, if you want our help we will need a lot more information:
What operating system are you using?
What shell are you using?
What are the formats of files FileA and FileB ?
Can you show us a representative sample of the contents of FileA and FileB and show us the results you hope to get when processing those two sample files?
And, most importantly, please show us what you have tried to solve this problem on your own.
Assuming you already have the two file locally (you will need to fetch FileA from the web server using something like wget ).
Also that the SHA keys are a string of 64 hex digits (0-9 a-f) which are separated from other text in file by one or more white space characters.
$SHELL -version
GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
Formats and Code:
Package: [package name]
Priority: extra
Section: --
Installed-Size: 12787
Maintainer: [Creator of the package]
Architecture: amd64
Source: [Source of the Package]
Version: [Version]
Depends: [Depends]
Filename: [Filename and directory of the file]
Size: [Filesize]
MD5sum: [checksum]
SHA1: [checksum]
SHA256: [checksum]
Description [description]
Homepage: [homepage]
Hi, thank you for this - I went ahead and tested this and it seems to work fine, I then modifed it to this format:
echo "The following keys were not found on the apt-mirror:" && grep -vf <(curl [repo-file] | grep �SHA256') <(cat [address-of-local-repo-file] | grep �SHA256') || echo "Files Match"
and this also seems to work.
So lets say I wanted to take a step further and wanted to also retrieve the program name and version of the repo's from 'ListA' that do not appear on ListB given that they are included in the list I mentioned above?