home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!morrow.stanford.edu!pln
- From: pln@egret0.Stanford.EDU (Patrick L. Nolan)
- Newsgroups: comp.lang.fortran
- Subject: Re: How to get command line arguments from unix with FORTRAN?
- Date: 25 Jan 1993 22:24:21 GMT
- Organization: Stanford University
- Lines: 40
- Message-ID: <1k1palINNao2@morrow.stanford.edu>
- References: <1993Jan25.214008.10580@leland.Stanford.EDU>
- Reply-To: pln@egret0.Stanford.EDU
- NNTP-Posting-Host: egret1.stanford.edu
- X-Newsreader: TIN [version 1.1 PL6]
-
- Peter Kocks (kocks@leland.Stanford.EDU) wrote:
- :
- : Subject says all.
- :
- : Can someone tell me how to read the command line arguments of
- : a unix command line from with FORTRAN. Something presumably similar
- : to the c
- :
- : main(int argc, char **argv){
- : }
- :
- It probably varies with the flavor of unix. On a Sun, you have:
-
- GETARG(3F) FORTRAN LIBRARY ROUTINES GETARG(3F)
-
- NAME
- getarg, iargc - get the kth command line argument
-
- SYNOPSIS
- subroutine getarg ( k, arg )
- character*(*) arg
-
- function iargc ()
-
- DESCRIPTION
- The statement call getarg( k , arg ) will get the kth
- command-line argument and put it into arg .
-
- The 0th argument is the command name.
-
- The function iargc returns the index of the last command-
- line argument,
- and therefore the number of arguments after the command
- name.
-
- --
- * Patrick L. Nolan (415)723-0133 *
- * W. W. Hansen Experimental Physics Laboratory (HEPL) *
- * Stanford University *
- * Bitnet: PLN@SLACVM Internet: pln@egret0.stanford.edu *
-