View Full Version : interface with cli tools
Doom9
2nd March 2004, 11:52
I have to run and process the output of several cli tools. Some only return one or multiple lines of text, then finish, others demand input at some point. I'm sure there's a way to handle this, I just can't find it (my google searching skills are failing me here). Samples, preferable in C++ would be much appreciated.
timecop
3rd March 2004, 03:49
they output to stdout, using printf, and take input from stdin?
http://www.0x68.com/shorts/consoleredir.asp
Probably the best reference evar
Doom9
3rd March 2004, 13:27
they output to stdout, using printf, and take input from stdin?I presume so though without having seen the sourcecode (and no chance of ever seeing it) I can't be certain. One tool is the cli cisco vpn client, which in the latest version has a stdin option which I presume could somehow be used to pipe answers to it, but there's zero documentation on it. The other program is output only, e.g. I run an operation and depending on what it normally writes to the console, I continue down two different roads.
Thanks for the link, I'll check it out.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.