Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.mac.system > #53391

Unix Q: "tee"

From john hevelin <bwotte@panix.com>
Newsgroups comp.sys.mac.system
Subject Unix Q: "tee"
Date 2013-12-16 05:34 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <l8m3ds$4hh$1@reader1.panix.com> (permalink)

Show all headers | View raw


I'm not sure if this is what the original poster was looking for.
My understanding is that he wanted to direct the standard output
of a command into two or more scripts that could run in parallel
using the tee(1) command.  I think this works:

% cat script0
#! /bin/bash
sed '20q' /usr/share/dict/words | tee >(./script1) | ./script2

% cat script1
#! /bin/bash
tr -d aeiou > script1.out

% cat script2
#! /bin/csh
tr -d tnshr > script2.out

% ./script0

% cat script1.out
A


l
l
m
An
rdvrk
rdwlf
Arn
Arnc
Arncl
Arnt
Arntc
Ar
Ab
b
Abbdh
Abb
bc

% cat script2.out
A
a
aa
aal
aalii
aam
Aai
aadvak
aadwolf
Aao
Aaoic
Aaoical
Aaoie
Aaoiic
Aau
Ab
aba
Ababde
Ababua
abac

It occurrs to me that if either script1 or script2 will be long
running that it might be expedient to run them in the background.
I'm not sophisticated enough with either sh(1) or bash(1) to know
how to do this, but maybe job control would suffice.

Back to comp.sys.mac.system | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Unix Q: "tee" john hevelin <bwotte@panix.com> - 2013-12-16 05:34 +0000
  Re: Unix Q: "tee" Barry Margolin <barmar@alum.mit.edu> - 2013-12-16 12:30 -0500

csiph-web