LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 03-29-2019, 05:58 AM   #1
Borneq
Member
 
Registered: Aug 2014
Posts: 36

Rep: Reputation: Disabled
How capture stdout of child process?


I want call RPC of bitcoin-cli and read answer.
 
Old 03-29-2019, 06:02 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,868
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Well, as you are writing a C-program (or at least you didn't say otherwise) I suggest using popen(3).
http://man7.org/linux/man-pages/man3/popen.3.html
 
1 members found this post helpful.
Old 03-29-2019, 06:19 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,897

Rep: Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317
yes, what language is it? what have you written so far? (just to give some details to be able to give some hints).
 
2 members found this post helpful.
Old 03-29-2019, 06:57 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by Borneq View Post
I want call RPC of bitcoin-cli and read answer.
Given that you've said "RPC" this points to a specific language, neither C, nor any scripting one.

As others have stated, you should be more clear about this language and also share a clip of the code you have written for this. Otherwise it is difficult for members to be able to help you because we would be guessing at exactly what best will help you.
 
1 members found this post helpful.
Old 03-29-2019, 05:02 PM   #5
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
As others have already said, you did not give us much to go on as far as understanding your question.

Please review the Site FAQ for guidance in posting your questions and general forum usage. Especially, read the link in that page, How To Ask Questions The Smart Way. The more effort you put into understanding your problem and framing your questions, the better others can help!
 
  


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
C++ - Problems while taking over STDIN and STDOUT of child process! MaxistXXL Programming 1 09-30-2010 07:47 PM
Under which circumstances a child process creates another child process using fork? mitsulas Programming 3 12-08-2009 08:16 AM
How to redirect the stdin and stdout of child process which exec interactive prog? john.daker Programming 1 11-04-2008 08:27 AM
How to capture both stdin and stdout of a child process? jineshkj Linux - Software 2 04-21-2006 06:34 AM
Killing a child process from another child marri Programming 6 10-01-2004 07:08 PM

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

All times are GMT -5. The time now is 12:40 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