Thread: exec system call

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    5

    exec system call

    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

  2. #2
    Registered User rohit's Avatar
    Join Date
    Feb 2002
    Posts
    69
    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

  3. #3
    Registered User
    Join Date
    Mar 2002
    Posts
    5
    what is the strtokl call.

  4. #4
    Registered User rohit's Avatar
    Join Date
    Feb 2002
    Posts
    69
    sorry typo mistake it's strtok


    Find the next token in a string.

    char *strtok( char *strToken, const char *strDelimit );


    cheers
    Rohit

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 02-04-2009, 06:54 AM
  2. Replies: 6
    Last Post: 07-21-2008, 03:10 AM
  3. nanosleep() -system call does some confusing things
    By jtk in forum Linux Programming
    Replies: 5
    Last Post: 08-30-2007, 04:15 AM
  4. Multiple types in lists, vectors or arrays.
    By megatron09 in forum C++ Programming
    Replies: 20
    Last Post: 08-31-2006, 01:54 PM
  5. Memory freeing after exec call?
    By Sethiorth in forum C Programming
    Replies: 4
    Last Post: 10-02-2004, 03:59 PM