home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / shell / 3844 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  1.5 KB

  1. Path: sparky!uunet!mcsun!news.funet.fi!hydra!klaava!klaava!hurtta
  2. From: hurtta@cs.Helsinki.FI (Kari E. Hurtta)
  3. Newsgroups: comp.unix.shell
  4. Subject: Re: "if () then" file tests in sh/csh/tcsh
  5. Message-ID: <HURTTA.92Sep8120911@plootu.Helsinki.FI>
  6. Date: 8 Sep 92 10:09:11 GMT
  7. References: <1992Sep8.095348@masg6.epfl.ch>
  8. Sender: news@klaava.Helsinki.FI (Uutis Ankka)
  9. Organization: Department of Computer Science, University of Helsinki, Finland
  10. Lines: 42
  11. In-Reply-To: posse@masg6.epfl.ch's message of 8 Sep 92 07: 53:48 GMT
  12.  
  13. In article <1992Sep8.095348@masg6.epfl.ch> posse@masg6.epfl.ch (Christian Posse) wrote:
  14. > Hi shells gurus !
  15. > In the man of sh/csh/tcsh and the FAQ, I have not found a description of
  16. > the file tests in "if" expressions :
  17. > What means "if ( -d file && -x file) then". 
  18. > Which parameters are available and for what (-d, -x, -t, .. ?)
  19. > Which complexity is possible : how many ()/&&/... I guess && means "or"
  20. > but which symbol for "and" ....
  21. > Is there a documentation available ?
  22.  
  23. In sh format is:
  24.     if program arguments... 
  25.     then 
  26.         commands...
  27.     fi
  28.  
  29. (You can replace new line with ;)
  30.  
  31. There is program named [
  32. or that name thare isn't manual page, but 
  33. it have also another name: test
  34. For that name manual page exists.
  35. (If that program is called with name [ it
  36.  requires that last argument is ] otherwise
  37. isn't).
  38.  
  39. For csh/tcsh format:
  40. if ( expression ) then
  41. endif
  42.  
  43. There is in csh manual page tittle 'Expression 
  44. and Operators'. Look that.
  45.  
  46. - K E H
  47. ( Kari.Hurtta@Helsinki.FI,
  48.   hurtta@cc.Helsinki.FI,
  49.   hurtta@cs.Helsinki.FI,
  50.   HURTTA@FINUH.BITNET
  51. )
  52.