Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Oct 2000 12:14:56 +0200
From:      Sebastian Lederer <sleder2s@smail.inf.fh-rhein-sieg.de>
To:        Johan Pettersson <pettersson.johan@spray.se>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: execv
Message-ID:  <39E6E0A0.9379AEEE@inf.fh-rhein-sieg.de>

next in thread | raw e-mail | index | archive | help
> Hi!
> 
> I have problem with a C-program.
> 
> -----8<------------------------
> char *arglist[] = { "-e pine" };
> .
> .
> execv("/usr/X11R6/bin/xterm", arglist);
> -----8<------------------------
> 
> The function replaces the process image
> with xterm. But how do I pass arguments
> to xterm. (above doesn't work =(

It doesn't quite work that way. Try the following:

	char *arglist[] = { "xterm","-e","pine",NULL };
	.
	.
	execv("/usr/X11R6/bin/xterm",arglist);

You might want to take a closer look at the execv manual page.
Are you sure you don't want to use system() ?

- Sebastian Lederer


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?39E6E0A0.9379AEEE>