1 # Tests for process substitution: <(...), >(...) and =(...).
4 if grep '#define PATH_DEV_FD' $ZTST_testdir/../config.h > /dev/null 2>&1 ||
5 grep '#define HAVE_FIFOS' $ZTST_testdir/../config.h > /dev/null 2>&1; then
8 print 'First\tSecond\tThird\tFourth' >FILE1
9 print 'Erste\tZweite\tDritte\tVierte' >FILE2
11 ZTST_unimplemented="process substitution is not supported"
15 function copycat { cat "$@" }
18 paste <(cut -f1 FILE1) <(cut -f3 FILE2)
22 # slightly desperate hack to force >(...) to be synchronous
23 { paste <(cut -f2 FILE1) <(cut -f4 FILE2) } > >(sed 's/e/E/g' >OUTFILE)
28 diff =(cat FILE1) =(cat FILE2)
31 >< First Second Third Fourth
33 >> Erste Zweite Dritte Vierte
35 copycat <(print First) <(print Zweite)
36 0:FDs remain open for external commands called from functions
47 catfield2 up,<(print $'\x64'own),sideways
48 0:<(...) when embedded within an argument
57 echo 'How sweet the moonlight sits upon the bank' >$args[2]
60 outputfield2 muddy,>(sed -e s/s/th/g >outputfield2.txt),vesture
62 while [[ ! -e outputfield2.txt || ! -s outputfield2.txt ]]; do :; done
64 0:>(...) when embedded within an argument
67 >How thweet the moonlight thitth upon the bank
75 catfield1 =(echo s$'\x69't),jessica
76 0:=(...) followed by something else without a break
82 # er... why is this treated as a glob?
83 print everything,=(here is left),alone
85 0:=(...) preceded by other stuff has no special effect
86 >everything,=(here is left),alone