Find the answer to your Linux question:
Results 1 to 3 of 3
Hello. I wrote a program in c and now at the end of this program I want it to execute objdump.sh. this script is in the same folder. How do ...
  1. #1
    Just Joined!
    Join Date
    Feb 2008
    Posts
    19

    How to execute a file (shell script)?

    Hello.

    I wrote a program in c and now at the end of this program
    I want it to execute objdump.sh. this script is in the same folder.
    How do i execute it?
    I tried execl("objdump.sh",""); but it doesnt work.

    Please help me.

  2. #2
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    Quote Originally Posted by PeroMed View Post
    Hello.

    I wrote a program in c and now at the end of this program
    I want it to execute objdump.sh. this script is in the same folder.
    How do i execute it?
    I tried execl("objdump.sh",""); but it doesnt work.

    Please help me.
    try system (const char *command);
    if you what to execute objdump.sh from the C exe

  3. #3
    Linux Newbie
    Join Date
    Jan 2008
    Location
    UK
    Posts
    211
    execl() function needs the full path to the executable shell script.
    if you use execlp() it searches the PATH for the program.
    This maybe a silly question but is the shell script permissions set to execute.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...