diff options
author | Jari Aalto <jari.aalto@cante.net> | 2002-07-17 14:10:11 +0000 |
---|---|---|
committer | Jari Aalto <jari.aalto@cante.net> | 2009-09-12 16:46:55 +0000 |
commit | 7117c2d221b2aed4ede8600f6a36b7c1454b4f55 (patch) | |
tree | b792f26ecca68813c51ed5ba2e381790758ef31b /tests/redir.right | |
parent | f73dda092b33638d2d5e9c35375f687a607b5403 (diff) | |
download | bash-7117c2d221b2aed4ede8600f6a36b7c1454b4f55.tar.gz |
Imported from ../bash-2.05b.tar.gz.devel-base-dist
Diffstat (limited to 'tests/redir.right')
-rw-r--r-- | tests/redir.right | 53 |
1 files changed, 48 insertions, 5 deletions
diff --git a/tests/redir.right b/tests/redir.right index 09272fe3..283bdcdb 100644 --- a/tests/redir.right +++ b/tests/redir.right @@ -1,9 +1,9 @@ abc -./redir.tests: /tmp/redir-test: cannot overwrite existing file +./redir.tests: line 13: /tmp/redir-test: cannot overwrite existing file abc def def -./redir.tests: $z: ambiguous redirect +./redir.tests: line 29: $z: ambiguous redirect Point 1 Point 2 to a @@ -24,8 +24,8 @@ read line3 "cd" read line4 "daemon" from stdin: aa to stdout -./redir4.sub: $fd: ambiguous redirect -./redir4.sub: $fd: ambiguous redirect +./redir4.sub: line 32: $fd: ambiguous redirect +./redir4.sub: line 33: $fd: ambiguous redirect /tmp/err-and-out: to stdout to stderr @@ -44,4 +44,47 @@ kl ab cd cd -./redir.tests: redir1.*: No such file or directory +./redir.tests: line 152: redir1.*: No such file or directory +# tests of ksh93-like dup-and-close redirection operators +exec 9<$0 + +f() +{ +exec 5<$0 + +exec 0<&5- + +while read line; do +echo "$line" +done +} + +f + +typeset -f f + +# make sure it was closed +read -u 5 foo +echo after read + +exec 5<&0 + +exec <&- + +read abcde + +exec 0<&9- +read line +echo $line +f () +{ + exec 5<$0; + exec 0<&5-; + while read line; do + echo "$line"; + done +} +./redir5.sub: line 20: read: 5: invalid file descriptor: Bad file descriptor +after read +./redir5.sub: line 27: read: read error: 0: Bad file descriptor +# tests of ksh93-like dup-and-close redirection operators |