diff options
author | Paul Ackersviller <packersv@users.sourceforge.net> | 2007-04-12 01:44:55 +0000 |
---|---|---|
committer | Paul Ackersviller <packersv@users.sourceforge.net> | 2007-04-12 01:44:55 +0000 |
commit | 9d927bed443252d228ccab03d1f9cf0ab8e0bb72 (patch) | |
tree | 9d8139cb404496bb6432ed3e2ed422c253e0c606 /Test/D03procsubst.ztst | |
parent | 84943a02345821b0c9dd64418455b9aecd177960 (diff) | |
download | zsh-9d927bed443252d228ccab03d1f9cf0ab8e0bb72.tar.gz zsh-9d927bed443252d228ccab03d1f9cf0ab8e0bb72.tar.xz zsh-9d927bed443252d228ccab03d1f9cf0ab8e0bb72.zip |
Merge from trunk of workers/21064.
Diffstat (limited to 'Test/D03procsubst.ztst')
-rw-r--r-- | Test/D03procsubst.ztst | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Test/D03procsubst.ztst b/Test/D03procsubst.ztst new file mode 100644 index 000000000..e176d8934 --- /dev/null +++ b/Test/D03procsubst.ztst @@ -0,0 +1,38 @@ +# Tests for process substitution: <(...), >(...) and =(...). + +%prep + if grep '#define PATH_DEV_FD' $ZTST_testdir/../config.h > /dev/null 2>&1 || + grep '#define HAVE_FIFOS' $ZTST_testdir/../config.h > /dev/null 2>&1; then + mkdir procsubst.tmp + cd procsubst.tmp + print 'First\tSecond\tThird\tFourth' >FILE1 + print 'Erste\tZweite\tDritte\tVierte' >FILE2 + else + ZTST_unimplemented="process substitution is not supported" + true + fi + + function copycat { cat "$@" } + +%test + paste <(cut -f1 FILE1) <(cut -f3 FILE2) +0:<(...) substitution +>First Dritte + +# slightly desperate hack to force >(...) to be synchronous + { paste <(cut -f2 FILE1) <(cut -f4 FILE2) } > >(sed 's/e/E/g' >OUTFILE) + cat OUTFILE +0:>(...) substitution +>SEcond ViErtE + + diff =(cat FILE1) =(cat FILE2) +1:=(...) substituion +>1c1 +>< First Second Third Fourth +>--- +>> Erste Zweite Dritte Vierte + + copycat <(print First) <(print Zweite) +0:FDs remain open for external commands called from functions +>First +>Zweite |