Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!cme!sunset!chris From: chris@sunset.ncsl.nist.gov (Chris Schanzle) Newsgroups: comp.lang.c Subject: Re: Command line parameters with VAX C? Message-ID: <2457@durer.cme.nbs.gov> Date: 4 Jan 90 16:33:50 GMT References: <6808@lindy.Stanford.EDU> <1042@stsci.edu> <1191@mountn.dec.com> Sender: news@cme.nbs.gov Lines: 30 minow@mountn.dec.com (Martin Minow) writes: >Here's a simple way to define C executables as foreign commands with >a minimum of typing: [ugly procedure that I don't fully understand thanks to my ignorance on vms.] >Martin Minow >minow@thundr.enet.dec.com Recently I had to write a program that was 100% portable on Unix, Puke-Dos, and of course, VMS. Obviously, I ran into the brain-damaged run command in VMS also. I was hoping someone would post more information, rather than a procedure with little explanation. My solution was simple: compile it somewhere you expect it to stay put and do a $dir command to get the full device and directory name to build the following command (symbol?): $ prog :== $:[]program.exe [the "$" before is required. ".exe" suffix is optional.] Now when you type "prog" vms will run "program" with any arguments you give on the command line as argv[argc] parameters. Chuck this (single) line into your login.com file and don't worry about it any longer. No no fuss, no muss, and no ".com" files. __________ "I'm gonna need a beer Chris Schanzle, Computer Scientist to put these flames out..." Natnl Inst of Stds & Technology chris@sunset.ncsl.nist.gov