Date: Thu, 11 Oct 2001 16:09:11 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: JT Williams cc: djgpp AT delorie DOT com Subject: Re: duplicating stdin in shell script In-Reply-To: <20011011085728.A15517@kendall.sfbr.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, 11 Oct 2001, JT Williams wrote: > Is it possible/practical to duplicate stdin (without using tmp files) > so that it can be scanned twice in a shell script? If so, could someone > please show me a shell idiom to do this? > > For example, suppose I want to scan a tab-delimited text file to determine > the maximum width of each field, so I can then pass stdin to `expand' > using appropriate options. You could copy stdin to a temporary file, and then work on that.