home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / question / 10078 < prev    next >
Encoding:
Text File  |  1992-08-14  |  1.2 KB  |  42 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!wupost!gumby!destroyer!ncar!music.scd.ucar.edu!tparker
  3. From: tparker@music.scd.ucar.edu (Tom Parker)
  4. Subject: Re: csh foreach question
  5. Message-ID: <1992Aug14.145453.6052@ncar.ucar.edu>
  6. Keywords: csh,foreach
  7. Sender: news@ncar.ucar.edu (USENET Maintenance)
  8. Organization: Scientific Computing Divison/NCAR Boulder, CO
  9. References: <BswB6M.Dxw@news.cso.uiuc.edu> <wX3gPB3w164w@curlie.UUCP>
  10. Date: Fri, 14 Aug 1992 14:54:53 GMT
  11. Lines: 29
  12.  
  13. gordon@osiris.cso.uiuc.edu (John Gordon) writes:
  14.  
  15. >     Given the following script:
  16. > #
  17. > foreach line ( `cat this_script` )
  18. >   echo "$line"
  19. > end
  20. >     I would expect the output to be:
  21. > #
  22. > foreach line ( `cat this_script` )
  23. >   echo "$line"
  24. > end
  25. >     Is this what's supposed to happen?  Any help appreciated.
  26.  
  27. John,
  28.  
  29. I got somewhat better results by using double quotes, as follows:
  30.  
  31.      foreach line ("`cat this_script`")
  32.                    ^                 ^
  33. --
  34. +--------------------------------------------------------------------+
  35. | Tom Parker             |  National Center for Atmospheric Research |
  36. | tparker@ncar.ucar.edu  |  (303) 497-1227                           |
  37. +--------------------------------------------------------------------+
  38.