From owner-freebsd-questions Fri May 18 12:12:29 2001 Delivered-To: freebsd-questions@freebsd.org Received: from dsl-64-193-218-89.telocity.com (dsl-64-193-218-89.telocity.com [64.193.218.89]) by hub.freebsd.org (Postfix) with SMTP id C76D037B42C for ; Fri, 18 May 2001 12:12:26 -0700 (PDT) (envelope-from lucas@slb.to) Received: (qmail 8874 invoked by uid 1000); 18 May 2001 19:12:45 -0000 Date: Fri, 18 May 2001 14:12:45 -0500 From: Lucas Bergman To: Eric Boucher Cc: Josef Grosch , freebsd-questions@FreeBSD.ORG Subject: Re: C programming: how to execute command line? Message-ID: <20010518141245.C29486@billygoat.slb.to> Reply-To: lucas@slb.to References: <20010518153811.38550.qmail@web9404.mail.yahoo.com> <20010518084822.B14015@mooseriver.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010518084822.B14015@mooseriver.com>; from jgrosch@mooseriver.com on Fri, May 18, 2001 at 08:48:22AM -0700 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > I'm beggining programming in the C language and I want to know > > something: is it possible to simulate that a user have enter a > > command in a shell, and catch the exit code in a variable. > > man fork > man execl > man execve Quite right. One might add man waitpid man system to that list. Note that use of system() is considered harmful in combination with user input, because it uses the shell. Lucas To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message