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


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

Unix Q: "tee"

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-xxxfer.readnews.com!news-out.readnews.com!transit4.readnews.com!panix!not-for-mail
From john hevelin <bwotte@panix.com>
Newsgroups comp.sys.mac.system
Subject Unix Q: "tee"
Date Mon, 16 Dec 2013 05:34:52 +0000 (UTC)
Organization PANIX Public Access Internet and UNIX, NYC
Lines 67
Message-ID <l8m3ds$4hh$1@reader1.panix.com> (permalink)
NNTP-Posting-Host panix1.panix.com
X-Trace reader1.panix.com 1387172092 4657 166.84.1.1 (16 Dec 2013 05:34:52 GMT)
X-Complaints-To abuse@panix.com
NNTP-Posting-Date Mon, 16 Dec 2013 05:34:52 +0000 (UTC)
User-Agent tin/2.0.0-20110823 ("Ardenistiel") (UNIX) (NetBSD/6.1.2 (i386))
Xref csiph.com comp.sys.mac.system:53391

Show key headers only | 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