home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / shell / 4579 < prev    next >
Encoding:
Text File  |  1992-11-08  |  1.1 KB  |  34 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!ukma!wupost!uwm.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!uxa.cso.uiuc.edu!jal41820
  3. From: jal41820@uxa.cso.uiuc.edu (Smiley)
  4. Subject: Re: if syntax
  5. References: <1992Nov5.230024.14504@u.washington.edu> <6430@falcon.ukc.ac.uk>
  6. Message-ID: <BxB62z.230@news.cso.uiuc.edu>
  7. Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
  8. Organization: University of Illinois at Urbana
  9. Date: Fri, 6 Nov 1992 18:59:21 GMT
  10. Keywords: if, csh
  11. Lines: 21
  12.  
  13. bnb@ukc.ac.uk (B.N.Blackmore) writes:
  14. :)you to test for files, but this is not as flexible as the bourne shell way of
  15. :)doing it. If you still need to write this in C-Shell the following should do
  16. :)what you require. (no bets on it though)
  17.  
  18. :)#! /bin/csh
  19. :)if ((-e testes)&&(!(-z testes))) then
  20. :)    echo "yes"
  21. :)endif
  22.  
  23. You're making it a tad too complex.
  24.  
  25. if ( -s testes) then
  26.  
  27. works just fine.
  28.  
  29. -- 
  30.         Josh Laff              #     #      
  31. email to: smiley@uiuc.edu     _       _     Hello! I am a signature virus!  
  32.       (217) 384-6249         |#\_____/#|    Join the fun and copy mo*#(*&^!>.
  33.                               \#######/     
  34.