Communicating between C++ application and Shell script

F

FPGA05

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
 
H

Howard

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
 
V

Victor Bazarov

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
 
M

Mercator

Victor said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top