exec system call

This is a discussion on exec system call within the Linux Programming forums, part of the Platform Specific Boards category; how can i write a c program to read in a command, not command line, and then pass what they ...

  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, 05: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21