diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 18:33:23 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 18:33:23 +0000 |
commit | 1d5cace9db9aef76f26b2d7ba54bbb76443b00b2 (patch) | |
tree | 314a15dd1aa103da13bdc83ba1d2105a290bc5ba /tests/vredir.right | |
parent | Initial commit. (diff) | |
download | bash-89791e9f494bebe33a9c52292a98f4f079926078.tar.xz bash-89791e9f494bebe33a9c52292a98f4f079926078.zip |
Adding upstream version 5.0.upstream/5.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/vredir.right')
-rw-r--r-- | tests/vredir.right | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/tests/vredir.right b/tests/vredir.right new file mode 100644 index 0000000..f4fe0db --- /dev/null +++ b/tests/vredir.right @@ -0,0 +1,100 @@ +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 +bar is a function +bar () +{ + exec {v}> $TMPFILE; + echo $v +} +10 +line 1 +line 2 +line 3 +bar is a function +bar () +{ + exec {v}<<EOF +line 1 +line 2 +line 3 +EOF + + echo $v +} +10 +foo 1 +foo 2 +foo 3 +10 +/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 +10 11 +a +a +swizzle is a function +swizzle () +{ + fd0=0; + fd1=1; + exec {stdin}<&$fd0; + exec {stdout}>&$fd1 +} +12 10 +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 13: /dev/null: Invalid argument +unset +12 10 +a +a +swizzle is a function +swizzle () +{ + exec {fd[0]}<&0; + exec {fd[1]}>&1; + exec {stdin}<&${fd[0]}-; + exec {stdout}>&${fd[1]}- +} |