Command line parameters with VAX C?

John Barshinger barsh at stsci.EDU
Thu Jan 4 00:13:34 AEST 1990


>From article <6808 at lindy.Stanford.EDU>, by LC.YRS at 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 at 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 at stsci.edu



More information about the Comp.lang.c mailing list