From 4aca87515a5083ae0e31ce3177189fd43b6d05ac Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 3 Jan 2015 13:58:15 +0100 Subject: patch to Vanilla Tomato 1.28 --- .../src/router/busybox/shell/ash_test/ash-read/read_ifs.right | 7 +++++++ .../src/router/busybox/shell/ash_test/ash-read/read_ifs.tests | 7 +++++++ .../src/router/busybox/shell/ash_test/ash-read/read_n.right | 3 +++ .../src/router/busybox/shell/ash_test/ash-read/read_n.tests | 3 +++ .../src/router/busybox/shell/ash_test/ash-read/read_r.right | 2 ++ .../src/router/busybox/shell/ash_test/ash-read/read_r.tests | 2 ++ .../src/router/busybox/shell/ash_test/ash-read/read_t.right | 4 ++++ .../src/router/busybox/shell/ash_test/ash-read/read_t.tests | 10 ++++++++++ 8 files changed, 38 insertions(+) create mode 100644 release/src/router/busybox/shell/ash_test/ash-read/read_ifs.right create mode 100755 release/src/router/busybox/shell/ash_test/ash-read/read_ifs.tests create mode 100644 release/src/router/busybox/shell/ash_test/ash-read/read_n.right create mode 100755 release/src/router/busybox/shell/ash_test/ash-read/read_n.tests create mode 100644 release/src/router/busybox/shell/ash_test/ash-read/read_r.right create mode 100755 release/src/router/busybox/shell/ash_test/ash-read/read_r.tests create mode 100644 release/src/router/busybox/shell/ash_test/ash-read/read_t.right create mode 100755 release/src/router/busybox/shell/ash_test/ash-read/read_t.tests (limited to 'release/src/router/busybox/shell/ash_test/ash-read') diff --git a/release/src/router/busybox/shell/ash_test/ash-read/read_ifs.right b/release/src/router/busybox/shell/ash_test/ash-read/read_ifs.right new file mode 100644 index 00000000..027ecd18 --- /dev/null +++ b/release/src/router/busybox/shell/ash_test/ash-read/read_ifs.right @@ -0,0 +1,7 @@ +.a. .b. .c. +.a. .b. .c. +.a. .. .b,c. +.a. .. .b,c. +.a. .. .c. +.a. .. .c. .d. +.a. .. .b,c,d , ,. diff --git a/release/src/router/busybox/shell/ash_test/ash-read/read_ifs.tests b/release/src/router/busybox/shell/ash_test/ash-read/read_ifs.tests new file mode 100755 index 00000000..cf7cd934 --- /dev/null +++ b/release/src/router/busybox/shell/ash_test/ash-read/read_ifs.tests @@ -0,0 +1,7 @@ +printf 'a\t\tb\tc\n' | ( IFS=$(printf "\t") read a b c; echo ".$a. .$b. .$c." ) +printf 'a\t\tb\tc\n' | ( IFS=$(printf " \t") read a b c; echo ".$a. .$b. .$c." ) +printf 'a,,b,c\n' | ( IFS="," read a b c; echo ".$a. .$b. .$c." ) +printf 'a,,b,c\n' | ( IFS=" ," read a b c; echo ".$a. .$b. .$c." ) +printf 'a ,, c\n' | ( IFS=" ," read a b c; echo ".$a. .$b. .$c." ) +printf 'a ,, c d\n' | ( IFS=" ," read a b c d; echo ".$a. .$b. .$c. .$d." ) +printf ' a,,b,c,d , ,\n' | ( IFS=" ," read a b c; echo ".$a. .$b. .$c." ) diff --git a/release/src/router/busybox/shell/ash_test/ash-read/read_n.right b/release/src/router/busybox/shell/ash_test/ash-read/read_n.right new file mode 100644 index 00000000..1f81af0b --- /dev/null +++ b/release/src/router/busybox/shell/ash_test/ash-read/read_n.right @@ -0,0 +1,3 @@ +test +tes +tes diff --git a/release/src/router/busybox/shell/ash_test/ash-read/read_n.tests b/release/src/router/busybox/shell/ash_test/ash-read/read_n.tests new file mode 100755 index 00000000..12423ba6 --- /dev/null +++ b/release/src/router/busybox/shell/ash_test/ash-read/read_n.tests @@ -0,0 +1,3 @@ +echo 'test' | (read reply; echo "$reply") +echo 'test' | (read -n 3 reply; echo "$reply") +echo 'test' | (read -n3 reply; echo "$reply") diff --git a/release/src/router/busybox/shell/ash_test/ash-read/read_r.right b/release/src/router/busybox/shell/ash_test/ash-read/read_r.right new file mode 100644 index 00000000..3536bf75 --- /dev/null +++ b/release/src/router/busybox/shell/ash_test/ash-read/read_r.right @@ -0,0 +1,2 @@ +testbest +test\ diff --git a/release/src/router/busybox/shell/ash_test/ash-read/read_r.tests b/release/src/router/busybox/shell/ash_test/ash-read/read_r.tests new file mode 100755 index 00000000..2c4cc610 --- /dev/null +++ b/release/src/router/busybox/shell/ash_test/ash-read/read_r.tests @@ -0,0 +1,2 @@ +echo -e 'test\\\nbest' | (read reply; echo "$reply") +echo -e 'test\\\nbest' | (read -r reply; echo "$reply") diff --git a/release/src/router/busybox/shell/ash_test/ash-read/read_t.right b/release/src/router/busybox/shell/ash_test/ash-read/read_t.right new file mode 100644 index 00000000..04126cbe --- /dev/null +++ b/release/src/router/busybox/shell/ash_test/ash-read/read_t.right @@ -0,0 +1,4 @@ +>< +>< +>test< +>test< diff --git a/release/src/router/busybox/shell/ash_test/ash-read/read_t.tests b/release/src/router/busybox/shell/ash_test/ash-read/read_t.tests new file mode 100755 index 00000000..d65f1aea --- /dev/null +++ b/release/src/router/busybox/shell/ash_test/ash-read/read_t.tests @@ -0,0 +1,10 @@ +# bash 3.2 outputs: + +# >< +{ echo -n 'te'; sleep 2; echo 'st'; } | (read -t 1 reply; echo ">$reply<") +# >< +{ sleep 2; echo 'test'; } | (read -t 1 reply; echo ">$reply<") +# >test< +{ echo -n 'te'; sleep 1; echo 'st'; } | (read -t 2 reply; echo ">$reply<") +# >test< +{ sleep 1; echo 'test'; } | (read -t 2 reply; echo ">$reply<") -- cgit v1.2.3-54-g00ecf