summaryrefslogtreecommitdiffstats
path: root/tests/lastpipe3.sub
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lastpipe3.sub')
-rw-r--r--tests/lastpipe3.sub11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/lastpipe3.sub b/tests/lastpipe3.sub
new file mode 100644
index 0000000..b9222b8
--- /dev/null
+++ b/tests/lastpipe3.sub
@@ -0,0 +1,11 @@
+# problem in bash-5.1 running lastpipe in subshell if fd 0 is closed
+
+shopt -s lastpipe
+exec 0<&-
+
+echo x | read x
+echo x=$x
+unset x
+
+echo x | cat | read x
+echo x=$x