Fedora Linux Support Community & Resources Center
  #1  
Old 31st December 2011, 03:16 AM
ankur0921 Offline
Registered User
 
Join Date: Apr 2010
Posts: 11
linuxredhatfirefox
Question linux command & c program ?

Hi All,

Can anybody put some light on the percentage usage of shell scipt / linux command usage in c program via system() function ? Is it feasible to use shell script / linux command n c program ? Can anybody provide some referene / standard on shell script / linux command usage with c ?

Thanks to all.


Reply With Quote
  #2  
Old 31st December 2011, 09:23 AM
Alberth5674764 Offline
Registered User
 
Join Date: Nov 2011
Posts: 35
linuxfirefox
Re: linux command & c program ?

Quote:
Originally Posted by ankur0921 View Post
Can anybody put some light on the percentage usage of shell scipt / linux command usage in c program via system() function ?
My guess is that it is about 0.

If you can do some task with a shell script, there is no point in wrapping it in a C program. It is much simpler to directly call the shell script instead.

You drop down to a regular programming language only when you cannot express something in a higher level language. Since programming it in a low level language is more work, you do as little as possible there, and use a high level scripting language to glue all pieces together.

I am not much of a fan of shell scripting for anything beyond a simple sequence of commands, I tend to switch to Python instead, which is much easier to program than C.

Quote:
Originally Posted by ankur0921 View Post
Is it feasible to use shell script / linux command n c program ?
Feasible? Sure it is, just use system() in C, but I don't see why you'd do this in the first place.


Quote:
Originally Posted by ankur0921 View Post
Can anybody provide some referene / standard on shell script / linux command usage with c ?
Like 'man system' ?
Reply With Quote
  #3  
Old 31st December 2011, 10:48 AM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,782
linuxfedorafirefox
Re: linux command & c program ?

Also note: for some purposes, use of the system library function is a security hazard.
Reply With Quote
  #4  
Old 1st February 2012, 08:14 AM
diamond_ramsey Offline
Registered User
 
Join Date: Aug 2009
Posts: 785
macossafari
Re: linux command & c program ?

Quote:
Originally Posted by jpollard View Post
Also note: for some purposes, use of the system library function is a security hazard.
Well said!!!
__________________
2 dual cores, 11 GB RAM, F18 Spherical Cow - 3.11.10-100.fc18.x86_64 / i686
2 dual cores, 11 GB RAM, F19 Schrödinger's Cat - 3.14.13-100.fc19.x86_64 / i686
2 dual cores, 11 GB RAM, F20 Heisenbug - 3.15.6-200.fc20.x86_64 / i686
16 x86_64 computing cores, 80 GB RAM & 8 SATA Seagate 7200.12 500 GB harddisks
Reply With Quote
Reply

Tags
command, linux, linux command / c program, program

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
fedora 11: command to start program tonjg Using Fedora 2 4th November 2009 11:17 PM
Command to end associations between program and terminal 1jackjack Using Fedora 3 29th June 2007 10:23 AM
program-generated shell command? kornelix Programming & Packaging 6 18th May 2006 10:02 PM
command line mail program paperdiesel Using Fedora 9 13th July 2004 10:11 PM


Current GMT-time: 14:24 (Monday, 28-07-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat