1 # $FreeBSD: head/bin/sh/tests/builtins/read1.0 190300 2009-03-22 23:00:52Z stefanf $
4 echo "1 2 3" | { read a; echo "x${a}x"; }
5 echo "1 2 3" | { read a b; echo "x${a}x${b}x"; }
6 echo "1 2 3" | { read a b c; echo "x${a}x${b}x${c}x"; }
7 echo "1 2 3" | { read a b c d; echo "x${a}x${b}x${c}x${d}x"; }
9 echo " 1 2 3 " | { read a b c; echo "x${a}x${b}x${c}x"; }
10 echo " 1 2 3 " | { unset IFS; read a b c; echo "x${a}x${b}x${c}x"; }
11 echo " 1 2 3 " | { IFS=$(printf ' \t\n') read a b c; echo "x${a}x${b}x${c}x"; }
12 echo " 1 2 3 " | { IFS= read a b; echo "x${a}x${b}x"; }
14 echo " 1,2 3 " | { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; }
15 echo ", 2 ,3" | { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; }
16 echo " 1 ,,3" | { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; }
17 echo " 1 , , 3" | { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; }
18 echo " 1 ,2 3," | { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; }
19 echo " 1 ,2 3,," | { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; }
21 echo " 1,2 3 " | { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; }
22 echo ", 2 ,3" | { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; }
23 echo " 1 ,,3" | { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; }
24 echo " 1 , , 3" | { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; }
25 echo " 1 ,2 3," | { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; }
26 echo " 1 ,2 3,," | { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; }