Use $(...) notation for subshells in system tests

The changes were mostly done with sed:

find . -name '*.sh' | xargs sed -i 's/`\([^`]*\)`/$(\1)/g'

There have been a few manual changes where the regex wasn't sufficient
(e.g. backslashes inside the `...`) or wrong (`...` referring to docs or
in comments).
This commit is contained in:
Tom Krizek
2023-06-26 18:35:04 +02:00
parent d203681a75
commit 05baf7206b
52 changed files with 418 additions and 416 deletions

View File

@@ -37,11 +37,11 @@ algo=1 flags=0 iters=12 salt="aabbccdd"
while read name hash
do
echo_i "checking $NSEC3HASH $name"
{ out=`$NSEC3HASH $salt $algo $iters $name`; rc=$?; } || true
{ out=$($NSEC3HASH $salt $algo $iters $name); rc=$?; } || true
checkout $rc
echo_i "checking $NSEC3HASH -r $name"
{ out=`$NSEC3HASH -r $algo $flags $iters $salt $name`; rc=$?; } || true
{ out=$($NSEC3HASH -r $algo $flags $iters $salt $name); rc=$?; } || true
checkout $rc
done <<EOF
@@ -67,22 +67,22 @@ checkempty() {
}
name=com algo=1 flags=1 iters=0
echo_i "checking $NSEC3HASH '' $name"
{ out=`$NSEC3HASH '' $algo $iters $name`; rc=$?; } || true
{ out=$($NSEC3HASH '' $algo $iters $name); rc=$?; } || true
checkempty $rc
echo_i "checking $NSEC3HASH - $name"
{ out=`$NSEC3HASH - $algo $iters $name`; rc=$?; } || true
{ out=$($NSEC3HASH - $algo $iters $name); rc=$?; } || true
checkempty $rc
echo_i "checking $NSEC3HASH -- '' $name"
{ out=`$NSEC3HASH -- '' $algo $iters $name`; rc=$?; } || true
{ out=$($NSEC3HASH -- '' $algo $iters $name); rc=$?; } || true
checkempty $rc
echo_i "checking $NSEC3HASH -- - $name"
{ out=`$NSEC3HASH -- - $algo $iters $name`; rc=$?; } || true
{ out=$($NSEC3HASH -- - $algo $iters $name); rc=$?; } || true
checkempty $rc
echo_i "checking $NSEC3HASH -r '' $name"
{ out=`$NSEC3HASH -r $algo $flags $iters '' $name`; rc=$?; } || true
{ out=$($NSEC3HASH -r $algo $flags $iters '' $name); rc=$?; } || true
checkempty $rc
echo_i "checking $NSEC3HASH -r - $name"
{ out=`$NSEC3HASH -r $algo $flags $iters - $name`; rc=$?; } || true
{ out=$($NSEC3HASH -r $algo $flags $iters - $name); rc=$?; } || true
checkempty $rc
checkfail() {
@@ -94,13 +94,13 @@ checkfail() {
esac
}
echo_i "checking $NSEC3HASH missing args"
{ out=`$NSEC3HASH 00 1 0 2>&1`; rc=$?; } || true
{ out=$($NSEC3HASH 00 1 0 2>&1); rc=$?; } || true
checkfail $rc
echo_i "checking $NSEC3HASH extra args"
{ out=`$NSEC3HASH 00 1 0 two names 2>&1`; rc=$?; } || true
{ out=$($NSEC3HASH 00 1 0 two names 2>&1); rc=$?; } || true
checkfail $rc
echo_i "checking $NSEC3HASH bad option"
{ out=`$NSEC3HASH -? 2>&1`; rc=$?; } || true
{ out=$($NSEC3HASH -? 2>&1); rc=$?; } || true
checkfail $rc
echo_i "exit status: $status"