home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / shell / 3160 < prev    next >
Encoding:
Internet Message Format  |  1992-07-28  |  1.7 KB

  1. Path: sparky!uunet!olivea!apple!news.oc.com!convex!tchrist
  2. From: tchrist@convex.COM (Tom Christiansen)
  3. Newsgroups: comp.unix.shell
  4. Subject: Re: simple csh question
  5. Message-ID: <1992Jul28.103300.12573@news.eng.convex.com>
  6. Date: 28 Jul 92 10:33:00 GMT
  7. References: <1992Jul28.005807.3129@hubcap.clemson.edu>
  8. Sender: usenet@news.eng.convex.com (news access account)
  9. Reply-To: tchrist@convex.COM (Tom Christiansen)
  10. Organization: CONVEX Realtime Development, Colorado Springs, CO
  11. Lines: 24
  12. Originator: tchrist@pixel.convex.com
  13. Nntp-Posting-Host: pixel.convex.com
  14. X-Disclaimer: This message was written by a user at CONVEX Computer
  15.               Corp. The opinions expressed are those of the user and
  16.               not necessarily those of CONVEX.
  17.  
  18. From the keyboard of bdbryan@eng.clemson.edu:
  19. :Does anyone know why the following shell code snippet for the csh keeps giving
  20. :me a "@: Expression syntax" error message? Code follows:
  21. :
  22. :foreach record (`cat somefile`) # `somefile' contains simple ascii records. one number
  23. :                                # to a line.
  24. :  @ ybacc = $ybacc + ((($record - $bave) * ($record - $bave))/$bcount)
  25. :end
  26. :
  27. :All the above variables are simple integer variables that have been previously
  28. :calculated. 
  29.  
  30. Would you believe it's because you've no space between your "/" and $bcount?
  31.  
  32. You can't predict the csh.  You can't trust it.   Just say no.
  33.  
  34. Thanks for yet another fine entry to csh.whynot .
  35.  
  36. --tom
  37. -- 
  38.     Tom Christiansen      tchrist@convex.com      convex!tchrist
  39.     If you have ever seen the grim word "login:" on a screen, your mind
  40.     is now a wholly-owned subsidiary of The Death Star.
  41.                 John Woods in <14105@ksr.com> of comp.unix.bsd
  42.