blob: 585a10ef6792e233bdfccf3c2bf7eb277053dde9 [file] [log] [blame]
10
foo 1
foo 2
foo 3
bar is a function
bar ()
{
exec {v}> $TMPFILE;
echo $v
}
./vredir.tests: line 6: v: readonly variable
./vredir.tests: line 6: v: cannot assign fd to variable
42
./vredir.tests: line 25: $v: Bad file descriptor
./vredir.tests: line 26: $v: Bad file descriptor
./vredir.tests: line 27: $v: Bad file descriptor
bar is a function
bar ()
{
exec {v}> $TMPFILE;
echo $v
}
11
line 1
line 2
line 3
bar is a function
bar ()
{
exec {v}<<EOF
line 1
line 2
line 3
EOF
echo $v
}
11
foo 1
foo 2
foo 3
11
/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
oclosev is a function
oclosev ()
{
exec {v}>&-
}
iclosev is a function
iclosev ()
{
exec {v}>&-
}
/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
./vredir3.sub: line 4: v: ambiguous redirect
after
11 12
a
a
swizzle is a function
swizzle ()
{
fd0=0;
fd1=1;
exec {stdin}<&$fd0;
exec {stdout}>&$fd1
}
13 11
a
a
swizzle is a function
swizzle ()
{
exec {fd0}<&0;
exec {fd1}>&1;
exec {stdin}<&$fd0-;
exec {stdout}>&$fd1-
}
ok 1
./vredir6.sub: redirection error: cannot duplicate fd: Invalid argument
./vredir6.sub: line 10: /dev/null: Invalid argument
./vredir6.sub: redirection error: cannot duplicate fd: Invalid argument
./vredir6.sub: line 13: v: Invalid argument
unset