ret=0
echo_i "Checking that default version works for query ($n)"
$DIG $DIGOPTS +short version.bind txt ch @10.53.0.1 > dig.out.ns1.$n
-tr -d '\r' < dig.out.ns1.$n | grep "^\"$VERSION\"$" > /dev/null || ret=1
+grep "^\"$VERSION\"$" dig.out.ns1.$n > /dev/null || ret=1
if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
n=`expr $n + 1`
ret=0
echo_i "Checking that custom version works for query ($n)"
$DIG $DIGOPTS +short version.bind txt ch @10.53.0.3 > dig.out.ns3.$n
-tr -d '\r' < dig.out.ns3.$n | grep "^\"this is a test of version\"$" > /dev/null || ret=1
+grep "^\"this is a test of version\"$" dig.out.ns3.$n > /dev/null || ret=1
if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
n=`expr $n + 1`
ret=0
echo_i "Checking that default hostname works for query ($n)"
$DIG $DIGOPTS +short hostname.bind txt ch @10.53.0.1 > dig.out.ns1.$n
-tr -d '\r' < dig.out.ns1.$n | grep "^\"$HOSTNAME\"$" > /dev/null || ret=1
+grep "^\"$HOSTNAME\"$" dig.out.ns1.$n > /dev/null || ret=1
if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
n=`expr $n + 1`
ret=0
echo_i "Checking that custom hostname works for query ($n)"
$DIG $DIGOPTS +short hostname.bind txt ch @10.53.0.3 > dig.out.ns3.$n
-tr -d '\r' < dig.out.ns3.$n | grep "^\"this.is.a.test.of.hostname\"$" > /dev/null || ret=1
+grep "^\"this.is.a.test.of.hostname\"$" dig.out.ns3.$n > /dev/null || ret=1
if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
n=`expr $n + 1`
ret=0
echo_i "Checking that server-id hostname works for query ($n)"
$DIG $DIGOPTS +short id.server txt ch @10.53.0.2 > dig.out.ns2.$n
-tr -d '\r' < dig.out.ns2.$n | grep "^\"$HOSTNAME\"$" > /dev/null || ret=1
+grep "^\"$HOSTNAME\"$" dig.out.ns2.$n > /dev/null || ret=1
if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
n=`expr $n + 1`
ret=0
echo_i "Checking that server-id hostname works for EDNS name server ID request ($n)"
$DIG $DIGOPTS +norec +nsid foo @10.53.0.2 > dig.out.ns2.$n
-tr -d '\r' < dig.out.ns2.$n | grep "^; NSID: .* (\"$HOSTNAME\")$" > /dev/null || ret=1
+grep "^; NSID: .* (\"$HOSTNAME\")$" dig.out.ns2.$n > /dev/null || ret=1
if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
n=`expr $n + 1`
ret=0
echo_i "Checking that custom server-id works for query ($n)"
$DIG $DIGOPTS +short id.server txt ch @10.53.0.3 > dig.out.ns3.$n
-tr -d '\r' < dig.out.ns3.$n | grep "^\"this.is.a.test.of.server-id\"$" > /dev/null || ret=1
+grep "^\"this.is.a.test.of.server-id\"$" dig.out.ns3.$n > /dev/null || ret=1
if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
n=`expr $n + 1`
ret=0
echo_i "Checking that custom server-id works for EDNS name server ID request ($n)"
$DIG $DIGOPTS +norec +nsid foo @10.53.0.3 > dig.out.ns3.$n
-tr -d '\r' < dig.out.ns3.$n | grep "^; NSID: .* (\"this.is.a.test.of.server-id\")$" > /dev/null || ret=1
+grep "^; NSID: .* (\"this.is.a.test.of.server-id\")$" dig.out.ns3.$n > /dev/null || ret=1
if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
echo_i "exit status: $status"
echo_i "checking dig over TCP works ($n)"
ret=0
$DIG $DIGOPTS +tcp @10.53.0.3 a a.example > dig.out.test$n || ret=1
- tr -d '\r' < dig.out.test$n | grep "10\\.0\\.0\\.1$" > /dev/null || ret=1
+ grep "10\.0\.0\.1$" < dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "checking dig +short +nosplit works($n)"
ret=0
$DIG $DIGOPTS +tcp @10.53.0.3 +short +nosplit DNSKEY dnskey.example > dig.out.test$n || ret=1
- tr -d '\r' < dig.out.test$n | grep "Z8plc4Rb9VIE5x7KNHAYTvTO5d4S8M=$" > /dev/null || ret=1
+ grep "Z8plc4Rb9VIE5x7KNHAYTvTO5d4S8M=$" < dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "checking dig +short +rrcomments works($n)"
ret=0
$DIG $DIGOPTS +tcp @10.53.0.3 +short +rrcomments DNSKEY dnskey.example > dig.out.test$n || ret=1
- tr -d '\r' < dig.out.test$n | grep -q "S8M= ; ZSK; alg = RSAMD5 ; key id = 30795$" > /dev/null || ret=1
+ grep "S8M= ; ZSK; alg = RSAMD5 ; key id = 30795$" < dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "checking dig +short +rrcomments works($n)"
ret=0
$DIG $DIGOPTS +tcp @10.53.0.3 +short +rrcomments DNSKEY dnskey.example > dig.out.test$n || ret=1
- tr -d '\r' < dig.out.test$n | grep -q "S8M= ; ZSK; alg = RSAMD5 ; key id = 30795$" > /dev/null || ret=1
+ grep "S8M= ; ZSK; alg = RSAMD5 ; key id = 30795$" < dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that dig processes +ednsopt=key-tag and FORMERR is returned ($n)"
$DIG $DIGOPTS @10.53.0.3 +ednsopt=key-tag a.example +qr > dig.out.test$n 2>&1 || ret=1
- tr -d '\r' < dig.out.test$n | grep "; KEY-TAG$" > /dev/null || ret=1
+ grep "; KEY-TAG$" dig.out.test$n > /dev/null || ret=1
grep "status: FORMERR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that dig processes +ednsopt=key-tag:<value-list> ($n)"
$DIG $DIGOPTS @10.53.0.3 +ednsopt=key-tag:00010002 a.example +qr > dig.out.test$n 2>&1 || ret=1
- tr -d '\r' < dig.out.test$n | grep "; KEY-TAG: 1, 2$" > /dev/null || ret=1
+ grep "; KEY-TAG: 1, 2$" dig.out.test$n > /dev/null || ret=1
grep "status: FORMERR" dig.out.test$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "check that dig -q -m works ($n)"
ret=0
$DIG $DIGOPTS @10.53.0.3 -q -m > dig.out.test$n 2>&1
- tr -d '\r' < dig.out.test$n | grep '^;-m\..*IN.*A$' > /dev/null || ret=1
+ grep '^;-m\..*IN.*A$' dig.out.test$n > /dev/null || ret=1
grep "Dump of all outstanding memory allocations" dig.out.test$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "checking delv over TCP works ($n)"
ret=0
$DELV $DELVOPTS +tcp @10.53.0.3 a a.example > delv.out.test$n || ret=1
- tr -d '\r' < delv.out.test$n | grep "10\\.0\\.0\\.1$" > /dev/null || ret=1
+ grep "10\.0\.0\.1$" < delv.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "checking delv +short +rrcomments works ($n)"
ret=0
$DELV $DELVOPTS +tcp @10.53.0.3 +short +rrcomments DNSKEY dnskey.example > delv.out.test$n || ret=1
- tr -d '\r' < delv.out.test$n | grep "S8M= ; ZSK; alg = RSAMD5 ; key id = 30795$" > /dev/null || ret=1
+ grep "S8M= ; ZSK; alg = RSAMD5 ; key id = 30795$" < delv.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "checking delv +short +nosplit +norrcomments works ($n)"
ret=0
$DELV $DELVOPTS +tcp @10.53.0.3 +short +nosplit +norrcomments DNSKEY dnskey.example > delv.out.test$n || ret=1
- tr -d '\r' < delv.out.test$n | grep -q "$NOSPLIT\$" > /dev/null || ret=1
+ grep "Z8plc4Rb9VIE5x7KNHAYTvTO5d4S8M=$" < delv.out.test$n > /dev/null || ret=1
if test `wc -l < delv.out.test$n` != 1 ; then ret=1 ; fi
f=`awk '{print NF}' < delv.out.test$n`
test "${f:-0}" -eq 4 || ret=1
done
serial=`awk '$3 == "serial" {print $1}' ns2/other.db`
newserial=`expr $serial + 1`
-sed "s/$serial/$newserial/" ns2/other.db > ns2/other.db.new
+sed s/$serial/$newserial/ ns2/other.db > ns2/other.db.new
echo 'frozen TXT "frozen addition"' >> ns2/other.db.new
mv -f ns2/other.db.new ns2/other.db
$RNDCCMD 10.53.0.2 thaw 2>&1 | sed 's/^/ns2 /' | cat_i
done
serial=`awk '$3 == "serial" {print $1}' ns2/nil.db`
newserial=`expr $serial + 1`
-sed "s/$serial/$newserial/" ns2/nil.db > ns2/nil.db.new
+sed s/$serial/$newserial/ ns2/nil.db > ns2/nil.db.new
echo 'frozen TXT "frozen addition"' >> ns2/nil.db.new
mv -f ns2/nil.db.new ns2/nil.db
$RNDCCMD 10.53.0.2 thaw 2>&1 | sed 's/^/ns2 /' | cat_i