How to execute shell through C program

Discussion in 'C' started by pawarsac, Jul 13, 2006.

  1. pawarsac

    pawarsac New Member

    Joined:
    Jul 13, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hello expert
    How to execute my own shell script through C program.
    waiting for reply..................

    sachin
     
  2. salichos

    salichos New Member

    Joined:
    Jul 25, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    check execl(), pipe() system calls.
     
  3. sumtaru

    sumtaru New Member

    Joined:
    May 17, 2012
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    You can execute like this :
    system("mysh");
    in unix operating system. mysh is the name of the shell script
     
  4. hRob

    hRob New Member

    Joined:
    May 18, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    in my experience, system() and execl() are the best ones to use. Make sure to raise their permissions before u execl them.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice