From 6c20c8ed2cb9ab69a1a57ccb2b9b79969a808321 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 17:38:56 +0200 Subject: Adding upstream version 5.2.15. Signed-off-by: Daniel Baumann --- tests/vredir.right | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 tests/vredir.right (limited to 'tests/vredir.right') diff --git a/tests/vredir.right b/tests/vredir.right new file mode 100644 index 0000000..6465595 --- /dev/null +++ b/tests/vredir.right @@ -0,0 +1,101 @@ +10 +foo 1 +foo 2 +foo 3 +bar is a function +bar () +{ + exec {v}> $TMPFILE; + echo $v +} +./vredir.tests: line 19: v: readonly variable +./vredir.tests: line 19: 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}<&- +} +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]}- +} +./vredir8.sub: line 12: $fd: Bad file descriptor -- cgit v1.2.3