Appending environment variable to system calls...

Jeff Racine racine at yunexus.yorku.ca
Tue Apr 2 08:14:53 AEST 1991


I wish to be able to set an environment variable (the path to a file)
and then to execute a program using the system() function in the
following fashion:

	char *s;
	s=getenv("FOO");
	system("FOO/FUBAR");

or something like that. I am using Turbo-C running under MS-DOS, and
the manuals do not seem to help me :-).

I know this is a simple problem and that I am missing something
obvious (such as I should not be using the system() function). I would
really like some help on this approach (or rather the correct
aproach).

Any help would be greatly appreciated.
--------------------------------------------------------------------
Jeff Racine        
racine at nexus.yorku.ca   
racine at yunexus.UUCP



More information about the Comp.lang.c mailing list