execlp

Jerry Feldman gaf at blu.org
Wed Mar 16 18:39:16 UTC 2011


On 03/16/2011 06:43 AM, xinyou yan wrote:
> Yes it is a function  defined in  the program.
> I will show  something like a shell.
> It wait  user to do what they want to . . What they can do , come from
> the function I define?
execlp(3) is a Linux library function that can be called only from an
executable program. The shells use this internally. The same
functionality is available from the Linux command line or from any shell:
foo arg1 arg2 .....

Normally in a C program you would fork(2) then exec. Effectively this
creates a subshell and executes the command in that shell.

You can use the bash exec function to redirect input and/or output.

-- 
Jerry Feldman <gaf at blu.org>
Boston Linux and Unix
PGP key id: 537C5846
PGP Key fingerprint: 3D1B 8377 A3C0 A5F2 ECBB  CA3B 4607 4319 537C 5846


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20110316/4658b704/attachment.bin 


More information about the users mailing list