LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 02-09-2009, 05:30 PM   #1
waqasdaar
Member
 
Registered: Jan 2009
Location: Stockholm Sweden
Distribution: Ubuntu 9.10
Posts: 57

Rep: Reputation: 15
Question storing value in C


Hi,

I have a C program which execute BASH script using 'System' command. This BASH script returns 0 or 1 plus print some some text on terminal output. I successfully retrieved the bash exit status result. But Is there any way around to retrieve the text in C program which BASH script print on the terminal.

Thanks in Advanced
 
Old 02-09-2009, 05:36 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,369

Rep: Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753
Try popen(): http://gd.tuwien.ac.at/languages/c/c...ONS/popen.html
 
Old 02-10-2009, 02:45 AM   #3
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Quote:
Originally Posted by waqasdaar View Post
But Is there any way around to retrieve the text in C program which BASH script print on the terminal
What are you doing?

You asked the exact same thing recently and got replies with complete solutions and full example code.

Then why start the same thing again?

Last edited by Hko; 02-10-2009 at 02:51 AM.
 
Old 02-11-2009, 06:27 AM   #4
waqasdaar
Member
 
Registered: Jan 2009
Location: Stockholm Sweden
Distribution: Ubuntu 9.10
Posts: 57

Original Poster
Rep: Reputation: 15
Yes its my mistake. I accept it.
 
  


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
storing crypto hectorDUQUE Fedora 3 07-18-2008 04:06 AM
Storing passwords Ze MoreirA Linux - Security 1 08-13-2007 05:41 AM
Storing user information. paroxsitic Linux - Newbie 1 04-04-2007 12:21 PM
storing settings on reboot d00bid00b Slackware 7 04-16-2006 03:58 AM
Storing Strings ToothlessRebel Programming 4 09-05-2004 03:16 AM

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

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

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