summary refs log tree commit diff
path: root/bin/cash/tests/builtins/read1.0
blob: 753613d06368ab12a61531ec6c266d88b40bf366 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# $FreeBSD: releng/12.0/bin/sh/tests/builtins/read1.0 190300 2009-03-22 23:00:52Z stefanf $
set -e

echo "1 2 3"		| { read a; echo "x${a}x"; }
echo "1 2 3"		| { read a b; echo "x${a}x${b}x"; }
echo "1 2 3"		| { read a b c; echo "x${a}x${b}x${c}x"; }
echo "1 2 3"		| { read a b c d; echo "x${a}x${b}x${c}x${d}x"; }

echo "	1  2 3 "	| { read a b c; echo "x${a}x${b}x${c}x"; }
echo "	1  2 3 "	| { unset IFS; read a b c; echo "x${a}x${b}x${c}x"; }
echo "	1  2 3 "	| { IFS=$(printf ' \t\n') read a b c; echo "x${a}x${b}x${c}x"; }
echo "	1  2 3 "	| { IFS= read a b; echo "x${a}x${b}x"; }

echo " 1,2 3 "		| { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; }
echo ", 2 ,3"		| { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; }
echo " 1 ,,3"		| { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; }
echo " 1 , , 3"		| { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; }
echo " 1 ,2 3,"		| { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; }
echo " 1 ,2 3,,"	| { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; }

echo " 1,2 3 "		| { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; }
echo ", 2 ,3"		| { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; }
echo " 1 ,,3"		| { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; }
echo " 1 , , 3"		| { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; }
echo " 1 ,2 3,"		| { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; }
echo " 1 ,2 3,,"	| { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; }
td>Split fields by tab onlyJune McEnroe 2021-01-12List both Makefile and html.sh under README.7June McEnroe 2021-01-12Add htagml exampleJune McEnroe 2021-01-12Use mandoc and htagml for bin htmlJune McEnroe 2021-01-12Add htagmlJune McEnroe 2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe 2021-01-11Publish "Using vi"June McEnroe 2021-01-11Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe 2021-01-09Add c -t flag to print expression typeJune McEnroe 2021-01-05Update taglineJune McEnroe