freebsd-nq/bin/sh/tests/builtins/read3.0

12 lines
634 B
Plaintext
Raw Normal View History

# $FreeBSD$
printf '%s\n' 'a\ b c' | { read a b; printf '%s\n' "x${a}x${b}x"; }
printf '%s\n' 'a b\ c' | { read a b; printf '%s\n' "x${a}x${b}x"; }
printf '%s\n' 'a\:b:c' | { IFS=: read a b; printf '%s\n' "x${a}x${b}x"; }
printf '%s\n' 'a:b\:c' | { IFS=: read a b; printf '%s\n' "x${a}x${b}x"; }
printf '%s\n' '\ a' | { read a b; printf '%s\n' "x${a}x${b}x"; }
printf '%s\n' '\:a' | { IFS=: read a b; printf '%s\n' "x${a}x${b}x"; }
printf '%s\n' '\\' | { read a b; printf '%s\n' "x${a}x${b}x"; }
printf '%s\n' '\\\ a' | { read a b; printf '%s\n' "x${a}x${b}x"; }
printf '%s\n' '\\\ a' | { read -r a b; printf '%s\n' "x${a}x${b}x"; }