ad814d6da2ad361fb48f67ac491e6fa91a07198e
[platform/upstream/bash.git] / tests / read.tests
1 echo " a " | (read x; echo "$x.")
2
3 echo " a  b  " | ( read x y ; echo -"$x"-"$y"- )
4 echo " a  b\ " | ( read x y ; echo -"$x"-"$y"- )
5 echo " a  b  " | ( read x ; echo -"$x"- )
6 echo " a  b\ " | ( read x ; echo -"$x"- )
7
8 echo " a  b\ " | ( read -r x y ; echo -"$x"-"$y"- )
9 echo " a  b\ " | ( read -r x ; echo -"$x"- )
10
11 echo "\ a  b\ " | ( read -r x y ; echo -"$x"-"$y"- )
12 echo "\ a  b\ " | ( read -r x ; echo -"$x"- )
13 echo " \ a  b\ " | ( read -r x y ; echo -"$x"-"$y"- )
14 echo " \ a  b\ " | ( read -r x ; echo -"$x"- )
15
16 echo "A B " > /tmp/IN
17 unset x y z
18 read x y z < /tmp/IN
19 echo 1: "x[$x] y[$y] z[$z]"
20 echo 1a: ${z-z not set}
21 read x < /tmp/IN
22 echo 2: "x[$x]"
23 rm /tmp/IN
24