www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/10/11/11:04:37

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: duplicating stdin in shell script
Date: 11 Oct 2001 14:44:51 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 16
Message-ID: <9q4b93$nm$1@nets3.rz.RWTH-Aachen.DE>
References: <20011011085728 DOT A15517 AT kendall DOT sfbr DOT org>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 1002811491 758 137.226.32.75 (11 Oct 2001 14:44:51 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 11 Oct 2001 14:44:51 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

JT Williams <jeffw AT darwin DOT sfbr DOT org> wrote:
> Is it possible/practical to duplicate stdin (without using tmp files)
> so that it can be scanned twice in a shell script?  

No.  You do need a tmp file.  On DOS, worrying about creation of a
temp file is a non-issue anyway, as even a simple | between programs
creates one already.

The basic problem is the possible size of stdin input.  *Something*
has to hold the full size of those input data, and if you rule out tmp
files, the only choice of place remaining would be RAM.  But you can't
assume that RAM is big enough to hold that file, and besides, the
Shell doesn't provide means of doing that, anyway.
-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019