~ubuntu-branches/ubuntu/trusty/bash/trusty-security

« back to all changes in this revision

Viewing changes to tests/redir5.sub

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-03-03 22:52:05 UTC
  • mfrom: (1.3.5) (2.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20140303225205-87ltrt5kspeq0g1b
Tags: 4.3-1ubuntu1
* Merge with Debian; remaining changes:
  - skel.bashrc:
    - Run lesspipe.
    - Enable ls aliases.
    - Set options in ll alias to -alF.
    - Define an alert alias.
    - Enabled colored grep aliases.
  - etc.bash.bashrc:
    - Add sudo hint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# tests of ksh93-like dup-and-close redirection operators
 
2
exec 9<$0
 
3
 
 
4
f()
 
5
{
 
6
exec 5<$0
 
7
 
 
8
exec 0<&5-
 
9
 
 
10
while read line; do
 
11
        echo "$line"
 
12
done
 
13
}
 
14
 
 
15
f
 
16
 
 
17
typeset -f f
 
18
 
 
19
# make sure it was closed
 
20
read -u 5 foo
 
21
echo after read
 
22
 
 
23
exec 5<&0
 
24
 
 
25
exec <&-
 
26
 
 
27
read abcde
 
28
 
 
29
exec 0<&9-
 
30
read line
 
31
echo $line