Xref: utzoo comp.unix.questions:22913 comp.unix.ultrix:3733 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!ames!eos!shelby!portia.stanford.edu!jerzy From: jerzy@portia.Stanford.EDU (Jerzy Czaplicki) Newsgroups: comp.unix.questions,comp.unix.ultrix Subject: HELP: how to reset redirected standard input in "sh" programs ? Message-ID: <1990Jun13.210212.16003@portia.Stanford.EDU> Date: 13 Jun 90 21:02:12 GMT Organization: Stanford University Lines: 41 Hi, I am writing a program that's supposed to be executed by "sh" and have a problem with data reading. The program creates a text file that is sequentially read to the end. Then a new, updated text file is created, its contents should be read & compared to the old one. The problem here is that "read" works with the first file only. The standard input is not reset to the beginning of the file and program tries to read the second file from the line number where the first one ended. Does anyone know how to make it read file from the beginning ? {I work on a system identifying itself as "Ultrix-32 V3.1 (Rev. 9).} Another problem: Command "sh prgm < data" works fine and data file is read as supposed. But input redirection within prgm doesn't work at all (keyboard is assumed to be standard input in spite of all "<" characters and contrarily to what the manual says). Why ? Thanks in advance, Jerzy. ------- Newsgroups: comp.unix.ultrix Subject: Re: biz.dec.* in the UK Summary: Expires: References: <1990Jun12.172822.20583@computing-maths.cardiff.ac.uk> Sender: Followup-To: Distribution: Organization: AIR, Stanford Universit Keywords: -- Jerzy