View Full Version : Alternative to background execution in Linux
karthikbalaguru
02-12-2009, 06:00 AM
Hi,
I would like to run one application initially .
After 10 seconds, i would like to execute the
second application from the shell.
Let the applications be named as
Application_1 and Application_2.
Application_1 will keep generating some
information continously. It is a continous loop
of information generation.
Application_2 will keep responding to the
information from the Application_1 continously.
Application_1 needs to be executed first
and after 10 seconds, i would like to
execute the Application_2 .
The query is, while Application_1 executes
first, the control will be with that application.
How will i be able to execute the Application_2
from the shell so that it would be able
process the information generated by the
Application_1 ?
Application_1 can be made to run in the
background and after 10 seconds, Application_2
can be invoked from the shell. But, is there
any other idea apart from making Application_1
to run in the background ?
Thx in advans,
Karthik Balaguru
karthikbalaguru wrote:
> Hi,
> I would like to run one application initially .
> After 10 seconds, i would like to execute the
> second application from the shell.
>
> Let the applications be named as
> Application_1 and Application_2.
>
> Application_1 will keep generating some
> information continously. It is a continous loop
> of information generation.
> Application_2 will keep responding to the
> information from the Application_1 continously.
> Application_1 needs to be executed first
> and after 10 seconds, i would like to
> execute the Application_2 .
>
> The query is, while Application_1 executes
> first, the control will be with that application.
> How will i be able to execute the Application_2
> from the shell so that it would be able
> process the information generated by the
> Application_1 ?
>
> Application_1 can be made to run in the
> background and after 10 seconds, Application_2
> can be invoked from the shell. But, is there
> any other idea apart from making Application_1
> to run in the background ?
>
> Thx in advans,
> Karthik Balaguru
I have no clue whether I have understood what exactly Your problem is
correctly. I think that what might be what You would like is have app1
exec app2 when it starts (I mean use the system call exec to start app2)
and have app2 sleep 10 seconds when it is started.
Sincerely,
Rene
karthikbalaguru
04-12-2009, 06:49 AM
On Dec 3, 4:21*pm, Rene <a...@b.c> wrote:
> karthikbalaguru wrote:
> > Hi,
> > I would like to run one application initially .
> > After 10 seconds, i would like to execute the
> > second application from the shell.
>
> > Let the applications be named as
> > Application_1 and Application_2.
>
> > Application_1 will keep generating some
> > information continously. It is a continous loop
> > of information generation.
> > Application_2 will keep responding to the
> > information from the Application_1 continously.
> > Application_1 needs to be executed first
> > and after 10 seconds, i would like to
> > execute the Application_2 .
>
> > The query is, while Application_1 executes
> > first, the control will be with that application.
> > How will i be able to execute the Application_2
> > from the shell so that it would be able
> > process the information generated by the
> > Application_1 ?
>
> > Application_1 can be made to run in the
> > background and after 10 seconds, Application_2
> > can be invoked from the shell. But, is there
> > any other idea apart from making Application_1
> > to run in the background ?
>
> > Thx in advans,
> > Karthik Balaguru
>
> I have no clue whether I have understood what exactly Your problem is
> correctly. I think that what might be what You would like is have app1
> exec app2 when it starts (I mean use the system call exec to start app2)
> and have app2 sleep 10 seconds when it is started.
>
Thx for your response. Interesting idea in combination with the sleep,
but, No, i am not looking for the execution of application_2 from
application_1 via execvp or related commands(system calls).
I am looking to get the control back to the terminal and execution of
the second application(application_2) from the shell/terminal as the
application_1 code cannot be changed.
Thx in advans,
Karthik Balaguru
hns@computer.org
04-12-2009, 07:08 AM
On 3 Dez., 17:49, karthikbalaguru <karthikbalagur...@gmail.com> wrote:
> On Dec 3, 4:21*pm, Rene <a...@b.c> wrote:
>
>
>
> > karthikbalaguru wrote:
> > > Hi,
> > > I would like to run one application initially .
> > > After 10 seconds, i would like to execute the
> > > second application from the shell.
>
> > > Let the applications be named as
> > > Application_1 and Application_2.
>
> > > Application_1 will keep generating some
> > > information continously. It is a continous loop
> > > of information generation.
> > > Application_2 will keep responding to the
> > > information from the Application_1 continously.
> > > Application_1 needs to be executed first
> > > and after 10 seconds, i would like to
> > > execute the Application_2 .
>
> > > The query is, while Application_1 executes
> > > first, the control will be with that application.
> > > How will i be able to execute the Application_2
> > > from the shell so that it would be able
> > > process the information generated by the
> > > Application_1 ?
>
> > > Application_1 can be made to run in the
> > > background and after 10 seconds, Application_2
> > > can be invoked from the shell. But, is there
> > > any other idea apart from making Application_1
> > > to run in the background ?
>
> > > Thx in advans,
> > > Karthik Balaguru
>
> > I have no clue whether I have understood what exactly Your problem is
> > correctly. I think that what might be what You would like is have app1
> > exec app2 when it starts (I mean use the system call exec to start app2)
> > and have app2 sleep 10 seconds when it is started.
>
> Thx for your response. Interesting idea in combination with the sleep,
> but, No, i am not looking for the execution of application_2 from
> application_1 via execvp or related commands(system calls).
> I am looking to get the control back to the terminal and execution of
> the second application(application_2) from the shell/terminal as the
> application_1 code cannot be changed.
>
> Thx in advans,
> Karthik Balaguru
shell command:
$ (sleep 10; application_2)&
$ application_1
-- hns
vBulletin® v3.8.3, Copyright ©2000-2010, Jelsoft Enterprises Ltd.