Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!lll-winken!sun-barr!newstop!sun!amdcad!dgcad!dg-rtp!spam!cochran From: cochran@spam.rtp.dg.com (Dave Cochran) Newsgroups: comp.lang.fortran Subject: Re: Command line arguements? Message-ID: <1991May30.113750.3925@dg-rtp.dg.com> Date: 30 May 91 11:37:50 GMT References: <24632@lanl.gov> Sender: usenet@dg-rtp.dg.com (Usenet Administration) Organization: Data General Corporation, Research Triangle Park, NC Lines: 28 In article <24632@lanl.gov>, jlg@cochiti.lanl.gov (Jim Giles) writes: |> In article , eesnyder@boulder.Colorado.EDU (Eric E. Snyder) writes: |> |> I need to write a program that takes arguements from the |> |> command line and passes them to variables with in the program. |> |> |> |> eg: |> |> |> |> a.out arg1 arg2 .... |> |> Yeah. I've always wanted to be able to do this on UNIX (with _any_ |> language). Unfortunately, the shell trashes the command line before |> I can have a look at it. I can turn that unsavory behaviour off - |> which is fine for me, but I can't be sure all the users of my software |> will turn it off. So, I have to do without a command line and deal |> with the junk the shell gives me instead. The shell trashes the command line? What about argc and argv, which are pretty standard things in C? Green Hills F77 also gives you a subroutine and a function called getarg (corresponding to argv) and iargc (corresponding to argc) that are used all the time to get the command line that executed the F77 program in the first place. -- +------------------------------------------------------+ |Dave Cochran (cochran@spam.rtp.dg.com) | |Data General Corporation, Research Triangle Park, NC | +------------------------------------------------------+ |Just suppose there were no hypothetical situations... | +------------------------------------------------------+