summaryrefslogtreecommitdiffstats
path: root/testfiles/cli_tests/compare.sh
blob: e928da3fb38afa3535e93a0f9b3c45f34d0ab83e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later

file1=$1
file2=$2

test -f "${file1}" || { echo "compare.sh: First file '${file1}' not found."; exit 1; }
test -f "${file2}" || { echo "compare.sh: Second file '${file2}' not found."; exit 1; }

if ! cmp "${file1}" "${file2}"; then
    echo "compare.sh: Files '${file1}' and '${file2}' are not identical'."
    exit 1
fi