🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1784

Re: Reading a file from withing a C-shell script

#1784
From: David I. Berg
Date: Thu, 15 Nov 1990 20:38
18 lines
936 bytes
In article <2945@uc.msc.umn.edu> wes@msc.edu writes:
>Suppose one has a file containing names of other files .......
>..........
>From a C-shell script, I would like to, one-by-one, get the names out
>of this data file and do something with them like this:
>
>............
>foreach file (my_file_list)
>   echo $file
>   process $file
>end
>
>Does anyone know how I do that?

foreach file (`cat my_file_list`)
   echo $file
   process $file
end
Technical Details
Message-ID: <1990Nov15.203804.14841@informix.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!usc!apple!voder!pyramid!infmx!dberg
References: <2945@uc.msc.umn.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!usc!apple!voder!pyramid!infmx!dberg
From: dberg@informix.com (David I. Berg)
Newsgroups: comp.unix.shell
Subject: Re: Reading a file from withing a C-shell script
Message-ID: <1990Nov15.203804.14841@informix.com>
Date: 15 Nov 90 20:38:04 GMT
References: <2945@uc.msc.umn.edu>
Sender: news@informix.com (Usenet News)
Organization: Informix Software, Inc.
Lines: 18