Communicating between C++ application and Shell script

Discussion in 'C++' started by FPGA05@gmail.com, Jul 19, 2005.

  1. Guest

    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 19, 2005
    #1
    1. Advertising

  2. Howard Guest

    <> wrote in message
    news:...
    > 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
    Howard, Jul 19, 2005
    #2
    1. Advertising

  3. 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
    Victor Bazarov, Jul 19, 2005
    #3
  4. Mercator Guest

    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
    Mercator, Jul 19, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sudsy
    Replies:
    3
    Views:
    2,226
    Jean-Yves Fiset
    May 5, 2004
  2. Christian Heimes
    Replies:
    0
    Views:
    601
    Christian Heimes
    Feb 27, 2008
  3. Gerardo Herzig
    Replies:
    1
    Views:
    1,080
    Philipp Pagel
    Feb 27, 2008
  4. Anton
    Replies:
    1
    Views:
    560
    Alexey Smirnov
    Aug 11, 2009
  5. moongeegee

    execute a shell script in a shell script

    moongeegee, Dec 3, 2007, in forum: Perl Misc
    Replies:
    2
    Views:
    250
    Ben Morrow
    Dec 4, 2007
Loading...

Share This Page