mirror of
https://github.com/moparisthebest/socat
synced 2024-11-10 19:15:03 -05:00
improve test for EXECSPACES to keep multiple spaces in arguments
This commit is contained in:
parent
31de787c8b
commit
67e59494c4
4
test.sh
4
test.sh
@ -8291,11 +8291,11 @@ TEST="$NAME: correctly parse exec with consecutive spaces"
|
|||||||
$PRINTF "test $F_n $TEST... " $N
|
$PRINTF "test $F_n $TEST... " $N
|
||||||
tf="$td/test$N.stdout"
|
tf="$td/test$N.stdout"
|
||||||
te="$td/test$N.stderr"
|
te="$td/test$N.stderr"
|
||||||
da="test$N $(date) $RANDOM"
|
da="test$N $(date) $RANDOM" # with a double space
|
||||||
tdiff="$td/test$N.diff"
|
tdiff="$td/test$N.diff"
|
||||||
# put the test data as first argument after two spaces. expect the data in the
|
# put the test data as first argument after two spaces. expect the data in the
|
||||||
# first argument of the exec'd command.
|
# first argument of the exec'd command.
|
||||||
$SOCAT $opts -u "exec:\"bash -c \\\"echo \$1\\\" \\\"\\\" \\\"$da\\\"\"" - >"$tf" 2>"$te"
|
$SOCAT $opts -u "exec:\"bash -c \\\"echo \\\\\\\"\$1\\\\\\\"\\\" \\\"\\\" \\\"$da\\\"\"" - >"$tf" 2>"$te"
|
||||||
rc=$?
|
rc=$?
|
||||||
echo "$da" |diff - "$tf" >"$tdiff"
|
echo "$da" |diff - "$tf" >"$tdiff"
|
||||||
if [ "$rc" -ne 0 ]; then
|
if [ "$rc" -ne 0 ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user