By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,583 Members | 1,042 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,583 IT Pros & Developers. It's quick & easy.

Communicating between C++ application and Shell script

P: n/a
Hello All,

I am developing a small application in which I would need a C++
application to read the output from a shell script. A shell script
keeps looking for user inputs and once the user gives his inputs it
runs a series of commands and writes an output to a file. Once the
output is producd it needs to communicate to the C++ aplication which
would then need to read from this file. This whole process repeats
continuously. Is there a way this can be accomplished. Am a novice in
this and would really appreciate if someone can point me in the right
direction

Thanks

Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

<FP****@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Hello All,

I am developing a small application in which I would need a C++
application to read the output from a shell script. A shell script
keeps looking for user inputs and once the user gives his inputs it
runs a series of commands and writes an output to a file. Once the
output is producd it needs to communicate to the C++ aplication which
would then need to read from this file. This whole process repeats
continuously. Is there a way this can be accomplished. Am a novice in
this and would really appreciate if someone can point me in the right
direction

Thanks


In what way do you want the shell script to "communicate" with the C++
program?

From your description, it sounds like you just want to run the C++ program
from your script, passing it the file name (and perhaps other info?) as
command line parameters. You do that the same way you do any other calls in
your shell script language (whatever that is).

For instructions on how to run a program and pass parameters to it for your
operating system, you'll need to consult the manuals for your OS, or ask in
a newsgroup dedicated to your OS.

-Howard


Jul 23 '05 #2

P: n/a
FP****@gmail.com wrote:
I am developing a small application in which I would need a C++
application to read the output from a shell script. A shell script
keeps looking for user inputs and once the user gives his inputs it
runs a series of commands and writes an output to a file. Once the
output is producd it needs to communicate to the C++ aplication which
would then need to read from this file. This whole process repeats
continuously. Is there a way this can be accomplished. Am a novice in
this and would really appreciate if someone can point me in the right
direction


Find a newsgroup about your OS, then ask there.

C++ has no idea what "a shell script" is, neither does it have any
mechanisms for interprocess communication, all those things exist at
the level of the operating system and should be accessed through the
mechanisms provided by the _library_ for programming your OS.

V
Jul 23 '05 #3

P: n/a
Victor Bazarov wrote:
Find a newsgroup about your OS, then ask there.
Why so?
C++ has no idea what "a shell script" is,
but it has an idea what a program argument is
neither does it have any
mechanisms for interprocess communication,
which certainly are not needed to process argv[1]
all those things exist at
the level of the operating system
maybe, but it's not relevant here
and should be accessed through the
mechanisms provided by the _library_ for programming your OS.


Nope

Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.