Path: utzoo!utgpu!news-server.csri.toronto.edu!helios.physics.utoronto.ca!ists!yunexus!racine From: racine@yunexus.yorku.ca (Jeff Racine) Newsgroups: comp.lang.c Subject: Appending environment variable to system calls... Summary: Wish to getenv() and append to system() call Message-ID: <22200@yunexus.YorkU.CA> Date: 1 Apr 91 22:14:53 GMT References: <11697.27f376d8@zeus.unomaha.edu> Sender: news@yunexus.YorkU.CA Organization: York University, Toronto, Ont. Lines: 21 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@nexus.yorku.ca racine@yunexus.UUCP