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

« back to all changes in this revision

Viewing changes to tests/source6.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 sourcing non-regular files, fixed post-3.2
 
2
 
 
3
: ${TMPDIR:=/tmp}
 
4
 
 
5
TMPFN=$TMPDIR/foo-$$
 
6
 
 
7
rm -f $TMPFN
 
8
echo "echo one - OK" > $TMPFN
 
9
. $TMPFN
 
10
echo $?
 
11
rm -f $TMPFN
 
12
 
 
13
# non-regular readable file
 
14
. /dev/null
 
15
echo $?
 
16
 
 
17
# FIFO or pipe via /dev/fd
 
18
. <(echo "echo two - OK")
 
19
echo $?
 
20
 
 
21
# pipe
 
22
echo "echo three - OK" | . /dev/stdin
 
23
echo $?
 
24
 
 
25
# FIFO
 
26
mkfifo $TMPDIR/fifo-$$
 
27
echo "echo four - OK" > $TMPDIR/fifo-$$ &
 
28
sleep 1         # allow the child echo to execute
 
29
. $TMPDIR/fifo-$$
 
30
echo $?
 
31
rm -f $TMPDIR/fifo-$$