HELP: how to reset redirected standard input in "sh" programs ?

Jerzy Czaplicki jerzy at portia.Stanford.EDU
Thu Jun 14 07:02:12 AEST 1990


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 at computing-maths.cardiff.ac.uk>
Sender: 
Followup-To: 
Distribution: 
Organization: AIR, Stanford Universit
Keywords: 


-- 
 Jerzy
<jerzy at portia.stanford.edu>
<j.jc at macbeth.stanford.edu>



More information about the Comp.unix.ultrix mailing list