469,076 Members | 1,309 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,076 developers. It's quick & easy.

Communicating between C++ application and Shell script

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
3 3373

<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
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
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.

Similar topics

2 posts views Thread by Eric Brunel | last post: by
7 posts views Thread by Paul Rubin | last post: by
10 posts views Thread by Nimit | last post: by
22 posts views Thread by Tony Houghton | last post: by
1 post views Thread by kevin.a.sweeney | last post: by
4 posts views Thread by =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.