home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!wupost!gumby!destroyer!ncar!music.scd.ucar.edu!tparker
- From: tparker@music.scd.ucar.edu (Tom Parker)
- Subject: Re: csh foreach question
- Message-ID: <1992Aug14.145453.6052@ncar.ucar.edu>
- Keywords: csh,foreach
- Sender: news@ncar.ucar.edu (USENET Maintenance)
- Organization: Scientific Computing Divison/NCAR Boulder, CO
- References: <BswB6M.Dxw@news.cso.uiuc.edu> <wX3gPB3w164w@curlie.UUCP>
- Date: Fri, 14 Aug 1992 14:54:53 GMT
- Lines: 29
-
- gordon@osiris.cso.uiuc.edu (John Gordon) writes:
-
- >
- > Given the following script:
- > #
- > foreach line ( `cat this_script` )
- > echo "$line"
- > end
- >
- > I would expect the output to be:
- >
- > #
- > foreach line ( `cat this_script` )
- > echo "$line"
- > end
- >
- > Is this what's supposed to happen? Any help appreciated.
-
- John,
-
- I got somewhat better results by using double quotes, as follows:
-
- foreach line ("`cat this_script`")
- ^ ^
- --
- +--------------------------------------------------------------------+
- | Tom Parker | National Center for Atmospheric Research |
- | tparker@ncar.ucar.edu | (303) 497-1227 |
- +--------------------------------------------------------------------+
-