ash: add read -u; fix read -t and read -n; add testsuite entries.
This commit is contained in:
3
shell/ash_test/ash-read/read_n.right
Normal file
3
shell/ash_test/ash-read/read_n.right
Normal file
@@ -0,0 +1,3 @@
|
||||
test
|
||||
tes
|
||||
tes
|
3
shell/ash_test/ash-read/read_n.tests
Executable file
3
shell/ash_test/ash-read/read_n.tests
Executable file
@@ -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")
|
2
shell/ash_test/ash-read/read_r.right
Normal file
2
shell/ash_test/ash-read/read_r.right
Normal file
@@ -0,0 +1,2 @@
|
||||
testbest
|
||||
test\
|
2
shell/ash_test/ash-read/read_r.tests
Executable file
2
shell/ash_test/ash-read/read_r.tests
Executable file
@@ -0,0 +1,2 @@
|
||||
echo -e 'test\\\nbest' | (read reply; echo "$reply")
|
||||
echo -e 'test\\\nbest' | (read -r reply; echo "$reply")
|
4
shell/ash_test/ash-read/read_t.right
Normal file
4
shell/ash_test/ash-read/read_t.right
Normal file
@@ -0,0 +1,4 @@
|
||||
><
|
||||
><
|
||||
>test<
|
||||
>test<
|
10
shell/ash_test/ash-read/read_t.tests
Executable file
10
shell/ash_test/ash-read/read_t.tests
Executable file
@@ -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<")
|
Reference in New Issue
Block a user