Commit 951dbc3b7f58c4718514650130fbe7c543b68e4d

Authored by Thorsten Schöning
Committed by Jay Berkenbilt
1 parent 3c1555a6

Fix expr syntax, support spaces in paths

expr needs ARG + ARG
quote paths to support support spaces
qpdf/qtest/qpdf/diff-encrypted
1 #!/bin/sh 1 #!/bin/sh
2 -lines=$(expr + $(diff $1 $2 | egrep '^[<>]' | egrep -v '(Date|InstanceID)' | wc -l)) 2 +lines=$(expr 0 + $(diff "$1" "$2" | egrep '^[<>]' | egrep -v '(Date|InstanceID)' | wc -l))
3 if [ "$lines" = "0" ]; then 3 if [ "$lines" = "0" ]; then
4 echo okay 4 echo okay
5 else 5 else
6 - diff -a -U 0 $1 $2 6 + diff -a -U 0 "$1" "$2"
7 fi 7 fi
qpdf/qtest/qpdf/diff-ignore-ID-version
1 #!/bin/sh 1 #!/bin/sh
2 -lines=$(expr + $(diff $1 $2 | egrep '^[<>]' | \ 2 +lines=$(expr 0 + $(diff "$1" "$2" | egrep '^[<>]' | \
3 egrep -v '/ID' | egrep -v '%PDF-' | wc -l)) 3 egrep -v '/ID' | egrep -v '%PDF-' | wc -l))
4 if [ "$lines" = "0" ]; then 4 if [ "$lines" = "0" ]; then
5 echo okay 5 echo okay
6 else 6 else
7 - diff -a -U 0 $1 $2 7 + diff -a -U 0 "$1" "$2"
8 fi 8 fi