home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!bu.edu!jade.tufts.edu!news.tufts.edu!news.tufts.edu!rdorich
- From: rdorich@jade.tufts.edu (Rob)
- Newsgroups: comp.unix.questions
- Subject: Re: csh foreach question
- Message-ID: <RDORICH.92Aug13103121@jade.tufts.edu>
- Date: 13 Aug 92 14:41:33 GMT
- References: <BswB6M.Dxw@news.cso.uiuc.edu>
- Sender: news@news.tufts.edu (USENET News System)
- Organization: Tufts University - Medford, MA
- Lines: 21
- In-Reply-To: gordon@osiris.cso.uiuc.edu's message of 13 Aug 92 00:11:08 GMT
-
- you wrote:
- >foreach line (`cat this_script`)
- > echo "$line"
- >end
- [more]
-
- And you were wondering why does it print one word per line. That is
- the correct behaviour, foreach takes every word as an item to work
- with. So, for example if you do foreach i (`echo line_above`)
- this will be equal to foreach i (the correct behaviour....).
- So the loop will go throug for 'the' 'correct' ....
- Hope this helps
-
- Rob
- --
-
- -------------------------------------------------------------------------------
- Roberto Dorich | /~~ \ / ~~/~~ /~~/ /~~ /| / /~~
- | SKI /-- X / /__/ /-- / |/ | /--
- rdorich@jade.tufts.edu | /__ / \ / /\ /__ / | /__
- -------------------------------------------------------------------------------
-