tests: change `...' to '...' on lines not matching /[=\$]/
[coreutils/ericb.git] / tests / misc / md5sum-bsd
blob8226d7ab747fa72f0403c18bacd8dc0232b69e32
1 #!/bin/sh
2 # make sure 'md5sum -c' works for alternate BSD format (md5 -r)
4 # Copyright (C) 2011-2012 Free Software Foundation, Inc.
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 . "${srcdir=.}/init.sh"; path_prepend_ ../src
20 print_ver_ md5sum
22 # Note we start this list with a name
23 # that's unambiguous in BSD format.
24 # I.E. one not starting with ' ' or '*'
25 for i in 'a' ' b' '*c' 'dd' ' '; do
26 echo "$i" > "$i"
27 md5sum "$i" >> check.md5sum
28 done
29 sed 's/ / /' check.md5sum > check.md5
31 # Note only a single format is supported per run
32 md5sum --strict -c check.md5sum || fail=1
33 md5sum --strict -c check.md5 || fail=1
35 # If we skip the first entry in the BSD format checksums
36 # then it'll be detected as standard format and error.
37 # This unlikely caveat was thought better than mandating
38 # an option to avoid the ambiguity.
39 tail -n+2 check.md5 | md5sum --strict -c && fail=1
41 Exit $fail