Computing.Net > Forums > Linux > C in ubuntu

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

C in ubuntu

Reply to Message Icon

Name: sandy1246
Date: October 24, 2009 at 09:53:03 Pacific
OS: Windows Vista
Subcategory: General
Tags: ubuntu, command line
Comment:

hi,im new to programmingin C in ubuntu and wanted to ask if we can execute ubuntu commands (such as 'ls','cd' etc) from our C program.if so,how?i dont get how to link our program with the OS's commands.please help.thanku



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: October 24, 2009 at 15:47:20 Pacific
Reply:


You have to use "C" system calls. The system() function can be used, but if you need to return the output of the command called from the "C" program, you must use the fork() call.

Check out these links for examples:

http://www.cs.appstate.edu/~jtw/cs3...
http://www.tek-tips.com/viewthread....
http://www.computing.net/answers/so...



-1

Response Number 2
Name: sandy1246
Date: October 25, 2009 at 12:36:43 Pacific
Reply:

thank you soo much!dis gave me the general idea,i think i can do the rest.thanxx again!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: C in ubuntu

how to run c program in ubuntu www.computing.net/answers/linux/how-to-run-c-program-in-ubuntu/30296.html

Vmware Grub error in Ubuntu 5.04 www.computing.net/answers/linux/vmware-grub-error-in-ubuntu-504/28051.html

install codecs in Ubuntu w/o 'net www.computing.net/answers/linux/install-codecs-in-ubuntu-wo-net/28531.html