mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-29 00:19:51 +02:00
commit bash-20171208 snapshot
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
test1
|
||||
foo
|
||||
test2
|
||||
test3
|
||||
test4
|
||||
8
|
||||
test5
|
||||
test6
|
||||
test7
|
||||
test8
|
||||
test8a
|
||||
test9
|
||||
hi
|
||||
bye
|
||||
l8r
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
intern
|
||||
1
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
extern
|
||||
1
|
||||
0
|
||||
0
|
||||
0
|
||||
0
|
||||
@@ -0,0 +1,93 @@
|
||||
# process substitution constructs that have caused problems in the past
|
||||
|
||||
eval cat <(echo test1)
|
||||
eval "echo foo;cat" <(echo test2)
|
||||
|
||||
unset f
|
||||
f=<(echo test3); cat "$f"
|
||||
|
||||
unset f
|
||||
eval f=<(echo test4) "; cat \$f"
|
||||
|
||||
unset f
|
||||
|
||||
FN=$TMPDIR/bashtest-procsub-$$
|
||||
cat >"$FN" <<EOF
|
||||
echo "test 12" | wc -c
|
||||
cat "\$1"
|
||||
EOF
|
||||
|
||||
source "$FN" <(echo test5)
|
||||
rm -f "$FN"
|
||||
unset FN
|
||||
|
||||
cat <( echo test6 ) <( echo test7 )
|
||||
cat <( echo test8 ; sleep 2; echo test8a ) <( echo test9 )
|
||||
|
||||
# Zev Weiss 11/7/2012
|
||||
fn() { cat | cat "$1"; }
|
||||
fn <(:) < /dev/null
|
||||
|
||||
unset -f fn
|
||||
|
||||
f1(){
|
||||
cat $1
|
||||
date >/dev/null
|
||||
}
|
||||
f2(){
|
||||
date >/dev/null
|
||||
cat $1
|
||||
}
|
||||
cat <(echo hi)
|
||||
f1 <(echo bye)
|
||||
f2 <(echo l8r)
|
||||
|
||||
unset -f f1 f2
|
||||
|
||||
moo() { ls -l "$1" >/dev/null; ls -l "$1" >/dev/null; }; moo >(true)
|
||||
moo() { ls -al "$1" >/dev/null; (true); ls -al "$1" >/dev/null; }; moo >(true)
|
||||
|
||||
unset -f moo
|
||||
|
||||
bug()
|
||||
{
|
||||
c=$(ulimit -n)
|
||||
let c+=100
|
||||
while let c--
|
||||
do
|
||||
while read -ru3 x
|
||||
do
|
||||
echo -n :
|
||||
done 3< <(echo x)
|
||||
done
|
||||
echo
|
||||
}
|
||||
|
||||
bug
|
||||
unset -f bug
|
||||
|
||||
count_lines()
|
||||
{
|
||||
wc -l < $1
|
||||
wc -l < $1
|
||||
wc -l < $1
|
||||
true | wc -l < $1
|
||||
wc -l < $1
|
||||
}
|
||||
|
||||
echo intern
|
||||
count_lines <(date)
|
||||
unset -f count_lines
|
||||
|
||||
echo extern
|
||||
FN=$TMPDIR/bashtest-$$
|
||||
cat >$FN <<EOF
|
||||
wc -l < \$1
|
||||
wc -l < \$1
|
||||
wc -l < \$1
|
||||
true | wc -l < \$1
|
||||
wc -l < \$1
|
||||
EOF
|
||||
|
||||
${THIS_SH} -c "source $FN <(date)"
|
||||
rm -f $FN
|
||||
@@ -0,0 +1,6 @@
|
||||
echo "warning: all of these tests will fail if process substitution has not" >&2
|
||||
echo "warning: been compiled into the shell or if the OS does not provide" >&2
|
||||
echo "warning: /dev/fd." >&2
|
||||
|
||||
${THIS_SH} ./procsub.tests > ${BASH_TSTOUT} 2>&1
|
||||
diff ${BASH_TSTOUT} procsub.right && rm -f ${BASH_TSTOUT}
|
||||
Reference in New Issue
Block a user