Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-17-2006, 06:54 AM   #1
Registered: Mar 2006
Posts: 86

Rep: Reputation: 15
shell scripts ...--can it be called with in a c program

mates ia hav a problem

-- can i call a shell script from a c program ?
Old 08-17-2006, 07:05 AM   #2
Senior Member
Registered: Jun 2006
Location: Hyderabad, India
Distribution: Fedora
Posts: 1,189

Rep: Reputation: 49
sure you can, there is a function called system(). Searh for it.
you could probably do this system("sh");
what system does is execute the command as your terminal.
Old 08-17-2006, 08:43 AM   #3
Registered: Apr 2006
Location: Vienna-Austria
Distribution: Suse 10.x, Fedora, DSL
Posts: 63

Rep: Reputation: 15
Certainly you can as described above with "system" call !
Be aware that a separate task is opened from the OS with all overhead required, so this might work out for calls that are not performance critical !


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How do I use the program called '*lit' ? rrsc16954 Mandriva 3 02-05-2006 12:04 PM
Debugging C++ so called from java program exitsfunnel Programming 3 10-12-2005 04:01 PM
Simulateing a Linux shell called MASH Virtualguy Programming 4 07-10-2005 06:59 PM
Do YOu Know a program Called SIG? benmay05 Linux - Software 2 06-27-2005 05:35 PM
passwordcracking program called slurpie Israfel2000 Linux - Software 3 11-26-2004 09:37 AM

All times are GMT -5. The time now is 11:19 AM.

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