home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / shell / 5121 next >
Encoding:
Text File  |  1992-12-21  |  1.5 KB  |  43 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!spool.mu.edu!umn.edu!csus.edu!netcom.com!dman
  3. From: dman@netcom.com (Dallman Ross)
  4. Subject: Re: Need quick-'n'-dirty syntax lesson in csh
  5. Message-ID: <1992Dec21.134145.5515@netcom.com>
  6. Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
  7. X-Newsreader: TIN [version 1.1 PL8]
  8. References: <1992Dec20.230614.26886@netcom.com>
  9. Date: Mon, 21 Dec 1992 13:41:45 GMT
  10. Lines: 31
  11.  
  12. Dallman Ross (dman@netcom.com) wrote:
  13.  
  14. : I'm writing a tiny csh script, and I need to know how the syntax is
  15. : formed in an "if"-statement for:
  16.  
  17. :     if <there is no argument3 ...>
  18.  
  19. : I have the "then"- and "else"-parts down fine, just need the "if"
  20. : syntax.  I grepped through man csh with no real luck.
  21.  
  22. Thanks so much to the two folks who emailed me answers.  I'll post the
  23. syntax here in case others are curious:
  24.  
  25. "If the number of arguments is less than three, then . . ."
  26.  
  27.     if ( $#argv < 3 ) then
  28.  
  29. "If the number of arguments is equal to three, then . . ."
  30.  
  31.     if ( $#argv == 3 ) then
  32.  
  33. "If there is a third argument, but it is empty, then . . ."
  34.  
  35.     if ( $argv[3] == "" ) then
  36.  
  37. --
  38.  __D_a l_l m a_n  _ R o_s s _ |dman@netcom.com  /or/  |"You sound like a man|
  39.  l  \\ l\\   /l  /\\  l\\   l |dross@well.sf.ca.us    |with a rubber nose." |
  40.  l   >)l \\ /ll /  \\ l \\  l |vox/fax: 1.510.645.1883| -- One-Lung Bill    |
  41.  l  // l  \X ll/--- \\l  \\ l |350 Perkins St., #108  |     Remmer (deceased)
  42. _l//______________________\\l_|Oakland,_CA__94610-3422|_____________________|_
  43.