Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ukma!rutgers!mcnc!thorin!ra!bollella From: bollella@ra.cs.unc.edu (Gregory Bollella) Newsgroups: comp.unix.questions Subject: Re: Some csh how-to, please Keywords: csh C-shell shell programming unix read Message-ID: <7485@thorin.cs.unc.edu> Date: 29 Mar 89 12:58:48 GMT References: <2127@pikes.Colorado.EDU> <7467@thorin.cs.unc.edu> Sender: news@thorin.cs.unc.edu Reply-To: bollella@ra.UUCP (Gregory Bollella) Organization: University Of North Carolina, Chapel Hill Lines: 24 In article <7467@thorin.cs.unc.edu> white@white.cs.unc.edu (Brian T. White) writes: >In article <2127@pikes.Colorado.EDU>, pklammer@pikes.Colorado.EDU (Peter Klammer) writes: >> Could someone please tell me how to read a file line at a time >> into the C shell? Better yet, can you refer me to any good C-shell >> text. > >Try "The UNIX C Shell Field Guide" by Anderson and Anderson. To read >a file one line at a time, try > >foreach p ( "`cat file`" ) > set line=`echo $p` > (commands acting on $line) >end I tried the above on a large file and it did not work. csh reported Too many words from ``. The file was 118583 bytes. Does anybody have any ideas on how to get around this limit and still get one line at a time? Gregory Bolella bollella@cs.unc.edu Department of Computer Science CB# 3175 Sitterson Hall University of North Carolina Chapel Hill, NC 27599-3175