Imported from ../bash-2.01.tar.gz.

This commit is contained in:
Jari Aalto 1997-06-05 14:59:13 +00:00
commit d166f04881
304 changed files with 14702 additions and 13012 deletions

View file

@ -22,3 +22,48 @@ read x < /tmp/IN
echo 2: "x[$x]"
rm /tmp/IN
# this is where the bash `read' behavior with respect to $REPLY differs
# from ksh93
echo "A B " > /tmp/IN
read < /tmp/IN
echo "[$REPLY]"
rm /tmp/IN
echo " A B " > /tmp/IN
read < /tmp/IN
echo "[$REPLY]"
rm /tmp/IN
# make sure that read with more variables than words sets the extra
# variables to the empty string
bvar=bvar
cvar=cvar
echo aa > /tmp/IN
read avar bvar cvar < /tmp/IN
echo =="$avar"==
echo =="$bvar"==
echo =="$cvar"==
rm /tmp/IN
# test behavior of read with various settings of IFS
echo " foo" | { IFS= read line; recho "$line"; }
echo " foo" | { IFS= ; read line; recho "$line"; }
echo " foo" | { unset IFS ; read line; recho "$line"; }
echo " foo" | { IFS=$'\n' ; read line; recho "$line"; }
echo " foo" | { IFS=$' \n' ; read line; recho "$line"; }
echo " foo" | { IFS=$' \t\n' ; read line; recho "$line"; }
echo " foo" | { IFS=$':' ; read line; recho "$line"; }