Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!noao-gemini!noao!stsci!barsh From: barsh@stsci.EDU (John Barshinger) Newsgroups: comp.lang.c Subject: Re: Command line parameters with VAX C? Message-ID: <1042@stsci.edu> Date: 3 Jan 90 13:13:34 GMT References: <6808@lindy.Stanford.EDU> Organization: Space Telescope Science Institute, Baltimore, MD 21218 Lines: 46 From article <6808@lindy.Stanford.EDU>, by LC.YRS@forsythe.stanford.edu (Richard Stanton): > Using C on my PC, I can pass command line parameters to programs via > the simple: > > progname [parameter list] > > On a VAX, I type cc [progname] to compile, link [progname...] to > link, and "run progname" to run a program. How do I pass command > line parameters (file names etc) to a program under this system? If > I type > > run progname parmlist > > I get a message complaining that RUN is being given too many > parameters. HELP RUN is not too informative. > > Thanks > > Richard Stanton > > pstanton@gsb-what.stanford.edu To use the argv,argc convention in VAX C, you must define the C program as a foreign command. EXAMPLE: $ fred :== $disk$fred:[fred]fred this will make the program fred in directory fred on disk$fred a foreign command (don't forget the initial $ in front of the disk name, it's very important) to run the program, type: $ fred arglist this will pass in the parameters to the c program. jrbii -- John Barshinger Space Telescope Science Institute Baltimore, MD 21218 plink:jrbii | bix:jrbii | barsh@stsci.edu