View Full Version : exec system call
weedus
03-07-2002, 12:39 AM
how can i write a c program to read in a command, not command line, and then pass what they enter into the exec system call and execute their command. the command can have any number of parameters
rohit
03-07-2002, 02:53 AM
hope you are not making a SUID program :) ;)
read manual of
"man execlp,execl.exec,excve
"use strtokl to parse the command from the arguments
cheers
Rohit
weedus
03-07-2002, 09:09 AM
what is the strtokl call.
rohit
03-07-2002, 09:34 PM
sorry typo mistake it's strtok
Find the next token in a string.
char *strtok( char *strToken, const char *strDelimit );
cheers
Rohit
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.