Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 May 2001 14:12:45 -0500
From:      Lucas Bergman <lucas@slb.to>
To:        Eric Boucher <eric_boucher60@yahoo.com>
Cc:        Josef Grosch <jgrosch@mooseriver.com>, freebsd-questions@FreeBSD.ORG
Subject:   Re: C programming: how to execute command line?
Message-ID:  <20010518141245.C29486@billygoat.slb.to>
In-Reply-To: <20010518084822.B14015@mooseriver.com>; from jgrosch@mooseriver.com on Fri, May 18, 2001 at 08:48:22AM -0700
References:  <20010518153811.38550.qmail@web9404.mail.yahoo.com> <20010518084822.B14015@mooseriver.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> > 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010518141245.C29486>