home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / fortran / 5175 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.6 KB  |  54 lines

  1. Path: sparky!uunet!stanford.edu!morrow.stanford.edu!pln
  2. From: pln@egret0.Stanford.EDU (Patrick L. Nolan)
  3. Newsgroups: comp.lang.fortran
  4. Subject: Re: How to get command line arguments from unix with FORTRAN?
  5. Date: 25 Jan 1993 22:24:21 GMT
  6. Organization: Stanford University
  7. Lines: 40
  8. Message-ID: <1k1palINNao2@morrow.stanford.edu>
  9. References: <1993Jan25.214008.10580@leland.Stanford.EDU>
  10. Reply-To: pln@egret0.Stanford.EDU
  11. NNTP-Posting-Host: egret1.stanford.edu
  12. X-Newsreader: TIN [version 1.1 PL6]
  13.  
  14. Peter Kocks (kocks@leland.Stanford.EDU) wrote:
  15. : Subject says all.
  16. : Can someone tell me how to read the command line arguments of
  17. : a unix command line from with FORTRAN.  Something presumably similar
  18. : to the c
  19. : main(int argc, char **argv){
  20. : }
  21. It probably varies with the flavor of unix.  On a Sun, you have:
  22.  
  23. GETARG(3F)          FORTRAN LIBRARY ROUTINES           GETARG(3F)
  24.  
  25. NAME
  26.      getarg, iargc - get the kth command line argument
  27.  
  28. SYNOPSIS
  29.      subroutine getarg ( k, arg )
  30.      character*(*) arg
  31.  
  32.      function iargc ()
  33.  
  34. DESCRIPTION
  35.      The statement call getarg( k  ,  arg  )  will  get  the  kth
  36.      command-line argument and put it into arg .
  37.  
  38.      The 0th argument is the command name.
  39.  
  40.      The function iargc returns the index of  the  last  command-
  41.      line argument,
  42.      and therefore the number  of  arguments  after  the  command
  43.      name.
  44.  
  45. --
  46. *   Patrick L. Nolan            (415)723-0133                 *
  47. *   W. W. Hansen Experimental Physics Laboratory (HEPL)       * 
  48. *   Stanford University                                       *
  49. *   Bitnet: PLN@SLACVM    Internet: pln@egret0.stanford.edu   *
  50.