Passing shell control to another app



Hi all,
I have an application (developed in C++ and compiled using gcc) that runs
from a shell, to which it outputs quite a bit of information (using
printf).

Part way through the execution of the application it executes another
instance of the same app (using fork followed by execl) and then the
original instance exits. When the original instance exists the user sees
the shell prompt, yet the second instance is still running and still
outputting to the shell.

Is there a way of doing this so that control of the shell is passed to the
second instance? I.e. I don't want the user to get control of the shell
until after the second instance has finished.

(It does this as this application is compiled for both Windows and Linux,
and to keep the logic flow the same same I want Linux to mimic what Windows
does).

Thanks,
Allistar.
.



Relevant Pages

  • Re: [opensuse] Future of SUSE (at home)
    ... BTW if you really want to make your windows stuff "just work" in linux, ... but you persist in saying "it can't be done". ... and you don't always need a shell. ...
    (SuSE)
  • Re: Ausgabe externer Anwendungen einlesen
    ... Unter Linux läuft folgendes Beispiel problemlos, unter Windows leider nicht. ... Du hast offensichtlich nicht verstanden was eine Shell ist, was meiner Ansicht nach, für jemand der unter Linux arbeitet mehr als erstaunlich ist. ... wenn du google nach java dir command befragst. ...
    (de.comp.lang.java)
  • Re: Vista security
    ... on windows, I am uncertain as to whether or not cygwin and mingw still work ... I was also talking about linux. ... this is what I meant, with a gui, I suspect errors of this sort are slightly ... the shell is a 2-edged sword. ...
    (comp.lang.misc)
  • Re: PC-Welt: =?UTF-8?B?IkbDvG5mIEdyw7xuZGUgZ2VnZW4gTGludXgi?=
    ... Tja, das ist halt Windows. ... Eine Konsole kann mehr als eine GUI. ... Geht eine Shell mit dem sudo-Prompt auf? ... unter Linux eben nicht die gleichen wie unter Windows, ...
    (de.comp.os.unix.linux.misc)
  • Re: is there a package that will remotely run a unix command from a windows box?
    ... It also has a better shell than the windows CLI. ... > a bash nearly identical to the linux version. ... terminals that were more than just one CLI (a shell being extra features ...
    (Fedora)