From owner-freebsd-questions Fri Oct 13 9:25:49 2000 Delivered-To: freebsd-questions@freebsd.org Received: from ux-2s02.inf.fh-rhein-sieg.de (ux-2s02.inf.fh-rhein-sieg.de [194.95.66.3]) by hub.freebsd.org (Postfix) with ESMTP id 6A11C37B67B for ; Fri, 13 Oct 2000 09:25:41 -0700 (PDT) Received: from inf.fh-rhein-sieg.de (pc-2n00.inf.fh-rhein-sieg.de [194.95.66.96]) by ux-2s02.inf.fh-rhein-sieg.de (8.9.3+Sun/8.9.1) with ESMTP id MAA07044; Fri, 13 Oct 2000 12:09:50 +0200 (MET DST) Message-ID: <39E6E0A0.9379AEEE@inf.fh-rhein-sieg.de> Date: Fri, 13 Oct 2000 12:14:56 +0200 From: Sebastian Lederer X-Mailer: Mozilla 4.74 [en] (X11; U; FreeBSD 4.1.1-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: Johan Pettersson Cc: freebsd-questions@FreeBSD.ORG Subject: Re: execv Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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