LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-26-2009, 11:01 PM   #1
baigmd
LQ Newbie
 
Registered: Oct 2009
Posts: 4

Rep: Reputation: 0
C program to execute shell script


Hi,

I am new...Can anyone give me a sample program to run shell script through C program.

Thanks
 
Old 10-26-2009, 11:24 PM   #2
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
easy
Code:
#include <Stdlib.h>
int main(){
return system (" <SHELL SCRIPT NAME HERE> ");
}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help with execute mulitple shell script within shell script ufmale Programming 6 09-13-2008 12:21 AM
Which program should I use to execute a shell script In Ubuntu 8.04 64-bit? joel.breger Linux - Newbie 4 05-26-2008 10:29 AM
How to execute shell through C program pawarsac Linux - Software 2 07-22-2006 04:23 AM
shell script how to execute x2000koh Programming 6 07-29-2003 04:20 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration