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