]> diplodocus.org Git - nmh/commitdiff
test/common.sh.in: use awk to pick off first output field.
authorLyndon Nerenberg <lyndon@orthanc.ca>
Fri, 6 Dec 2013 22:52:03 +0000 (14:52 -0800)
committerLyndon Nerenberg <lyndon@orthanc.ca>
Fri, 6 Dec 2013 22:52:03 +0000 (14:52 -0800)
md5 and md5sum are inconsistent in their use of SP vs HT as a field separator.
cut(1) can only handle a single field delimiter character; awk is more forgiving.

test/common.sh.in

index 1d55dff..7021412 100644 (file)
@@ -35,7 +35,7 @@ output_md5()
   #### the same line, the caller needs to add it.  This avoids
   #### differences due to a leading '*' binary file indicator, for
   #### text files, on some platforms (Cygwin).
-  @MD5SUM@ $* | @MD5FMT@ | cut -d ' ' -f 1
+  @MD5SUM@ $* | @MD5FMT@ | awk '{print $1}'
 }
 
 #### Use built-in $((...)) in test suite if shell supports it.