ash: add read -u; fix read -t and read -n; add testsuite entries.

This commit is contained in:
Denis Vlasenko
2008-03-25 00:07:12 +00:00
parent f39653e306
commit 59f351ccda
7 changed files with 91 additions and 55 deletions

View File

@@ -0,0 +1,3 @@
test
tes
tes

View 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")

View File

@@ -0,0 +1,2 @@
testbest
test\

View File

@@ -0,0 +1,2 @@
echo -e 'test\\\nbest' | (read reply; echo "$reply")
echo -e 'test\\\nbest' | (read -r reply; echo "$reply")

View File

@@ -0,0 +1,4 @@
><
><
>test<
>test<

View 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<")