home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / shell / 3509 < prev    next >
Encoding:
Text File  |  1992-08-17  |  1.5 KB  |  35 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!mcsun!sun4nl!dutrun!donau!donau.et.tudelft.nl!bas
  3. From: bas@phys.uva.nl (Bas de Bakker)
  4. Subject: Re: If shell command switches.
  5. In-Reply-To: gsa@alcor.concordia.ca's message of 17 Aug 92 17: 19:24 GMT
  6. Message-ID: <BAS.92Aug18100206@carlo.phys.uva.nl>
  7. Sender: news@donau.et.tudelft.nl (UseNet News System)
  8. Nntp-Posting-Host: carlo.phys.uva.nl
  9. Organization: Institute for Theoretical Physics, Amsterdam, the Netherlands
  10. References: <1992Aug6.195643.4702@prl.dec.com> <Bss2xD.GKE@root.co.uk>
  11.     <22412@sybase.sybase.com> <4755@daily-planet.concordia.ca>
  12. Date: Tue, 18 Aug 1992 15:02:06 GMT
  13. Lines: 20
  14.  
  15. >>>>> On 17 Aug 92 17:19:24 GMT, gsa@alcor.concordia.ca ( CON U GRADUATE STUDENTS' ASSOC ) said:
  16.  
  17. cugsa>does anyone know where I can find the complete switch listing 
  18. cugsa>of the "if" statement?  I can't seem to find it anywhere..ie:
  19. cugsa>man csh/tcsh/ksh.., yet I know of the if [-f] and if [-r] 
  20. cugsa>only because I saw it used in other scripts.  There are other
  21. cugsa>switches..but apparently sparse documentation as to what they 
  22. cugsa>are and do.
  23.  
  24. The if statement just looks whether its 'argument' is true or not. All
  25. these -f like switches between [ ] are really processed by the
  26. test(1) command. '[ expression ]' is equivalent to 'test expression'.
  27.  
  28. So, to get a list of these switches, do 'man test'.
  29.  
  30. (Some shells have a builtin test, but these take at least the switches
  31. of the system test and if there are more the shell manual should
  32. mention them.)
  33.  
  34. Bas de Bakker.
  35.