mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-13 23:20:49 +02:00
changes to mapfile, read builtins for unbuffered reads
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
BUILD_DIR=/usr/local/build/chet/bash/bash-current
|
||||
BUILD_DIR=/usr/local/build/bash/bash-current
|
||||
THIS_SH=$BUILD_DIR/bash
|
||||
PATH=$PATH:$BUILD_DIR
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ argv[1] = <foo>
|
||||
argv[1] = <foo>
|
||||
argv[1] = < foo>
|
||||
a = abcdefg
|
||||
xyz
|
||||
a = xyz
|
||||
a = -xyz 123-
|
||||
a = abc
|
||||
@@ -46,6 +47,7 @@ abcde
|
||||
abcde
|
||||
./read3.sub: line 17: read: -1: invalid number
|
||||
abc
|
||||
defg
|
||||
ab
|
||||
abc
|
||||
#
|
||||
@@ -76,3 +78,7 @@ unset or null 3
|
||||
[?2004h[?2004l
|
||||
timeout 3: ok
|
||||
unset or null 3
|
||||
timeout 4: ok
|
||||
abcde
|
||||
abcde
|
||||
one
|
||||
|
||||
@@ -112,3 +112,6 @@ ${THIS_SH} ./read6.sub
|
||||
|
||||
# test behavior of readline timeouts
|
||||
${THIS_SH} ./read7.sub
|
||||
|
||||
# test behavior of read -n and read -d on regular files
|
||||
${THIS_SH} ./read8.sub
|
||||
|
||||
@@ -15,6 +15,7 @@ a=7
|
||||
echo 'abcdefg|xyz' | {
|
||||
read -d '|' a
|
||||
echo a = "${a-unset}"
|
||||
cat - # make sure we don't read too much
|
||||
}
|
||||
|
||||
echo xyz 123 | {
|
||||
|
||||
@@ -20,6 +20,7 @@ read -n -1
|
||||
echo abcdefg | {
|
||||
read -n 3 xyz
|
||||
echo $xyz
|
||||
cat - # make sure we don't read too much
|
||||
}
|
||||
|
||||
# fewer chars than specified
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
tmpf=$TMPDIR/tmp-$$
|
||||
printf "%s\n" "one two three four" > $tmpf
|
||||
|
||||
# make sure we rewind the input properly when reading a specific number of
|
||||
# characters or using a non-standard delimiter from a regular file
|
||||
|
||||
exec <$tmpf
|
||||
read -n 4 input && echo "$input"
|
||||
cat -
|
||||
|
||||
exec <$tmpf
|
||||
read -d ' ' input && echo "$input"
|
||||
cat -
|
||||
|
||||
rm -f $tmpf
|
||||
Reference in New Issue
Block a user