Starting another program that shares output terminal with current program?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have a matlab script that I run from the terminal, that script creates an instance of another program using:
system('cd <path> && mpiexec -n 1 ./<program2> &')
Problem is I don't see any terminal output from program2
. (It works if I omit the ampersand, but I need program2
to run in the background). Is it possible to have both the matlab script and program2
output to the same terminal?
terminal background-process io matlab
add a comment |Â
up vote
0
down vote
favorite
I have a matlab script that I run from the terminal, that script creates an instance of another program using:
system('cd <path> && mpiexec -n 1 ./<program2> &')
Problem is I don't see any terminal output from program2
. (It works if I omit the ampersand, but I need program2
to run in the background). Is it possible to have both the matlab script and program2
output to the same terminal?
terminal background-process io matlab
Hmm, it's not clear at all what MATLAB does if anything with the output fromsystem('cmd&')
; I suspect you'll need to find a different way to solve this problem.
â thrig
Nov 19 '17 at 17:33
Perhaps you can add>&/dev/tty
to the mpiexec command to make it output to the terminal.
â meuh
Nov 19 '17 at 17:44
@meuh It didn't work. Still no output in terminal. Output works fine if I direct it to a logfile though...'.... ./<program2> > logfile 2>&1 &'
â Moody
Nov 19 '17 at 18:53
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a matlab script that I run from the terminal, that script creates an instance of another program using:
system('cd <path> && mpiexec -n 1 ./<program2> &')
Problem is I don't see any terminal output from program2
. (It works if I omit the ampersand, but I need program2
to run in the background). Is it possible to have both the matlab script and program2
output to the same terminal?
terminal background-process io matlab
I have a matlab script that I run from the terminal, that script creates an instance of another program using:
system('cd <path> && mpiexec -n 1 ./<program2> &')
Problem is I don't see any terminal output from program2
. (It works if I omit the ampersand, but I need program2
to run in the background). Is it possible to have both the matlab script and program2
output to the same terminal?
terminal background-process io matlab
edited Nov 19 '17 at 15:20
asked Nov 19 '17 at 13:44
Moody
11
11
Hmm, it's not clear at all what MATLAB does if anything with the output fromsystem('cmd&')
; I suspect you'll need to find a different way to solve this problem.
â thrig
Nov 19 '17 at 17:33
Perhaps you can add>&/dev/tty
to the mpiexec command to make it output to the terminal.
â meuh
Nov 19 '17 at 17:44
@meuh It didn't work. Still no output in terminal. Output works fine if I direct it to a logfile though...'.... ./<program2> > logfile 2>&1 &'
â Moody
Nov 19 '17 at 18:53
add a comment |Â
Hmm, it's not clear at all what MATLAB does if anything with the output fromsystem('cmd&')
; I suspect you'll need to find a different way to solve this problem.
â thrig
Nov 19 '17 at 17:33
Perhaps you can add>&/dev/tty
to the mpiexec command to make it output to the terminal.
â meuh
Nov 19 '17 at 17:44
@meuh It didn't work. Still no output in terminal. Output works fine if I direct it to a logfile though...'.... ./<program2> > logfile 2>&1 &'
â Moody
Nov 19 '17 at 18:53
Hmm, it's not clear at all what MATLAB does if anything with the output from
system('cmd&')
; I suspect you'll need to find a different way to solve this problem.â thrig
Nov 19 '17 at 17:33
Hmm, it's not clear at all what MATLAB does if anything with the output from
system('cmd&')
; I suspect you'll need to find a different way to solve this problem.â thrig
Nov 19 '17 at 17:33
Perhaps you can add
>&/dev/tty
to the mpiexec command to make it output to the terminal.â meuh
Nov 19 '17 at 17:44
Perhaps you can add
>&/dev/tty
to the mpiexec command to make it output to the terminal.â meuh
Nov 19 '17 at 17:44
@meuh It didn't work. Still no output in terminal. Output works fine if I direct it to a logfile though...
'.... ./<program2> > logfile 2>&1 &'
â Moody
Nov 19 '17 at 18:53
@meuh It didn't work. Still no output in terminal. Output works fine if I direct it to a logfile though...
'.... ./<program2> > logfile 2>&1 &'
â Moody
Nov 19 '17 at 18:53
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f405603%2fstarting-another-program-that-shares-output-terminal-with-current-program%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Hmm, it's not clear at all what MATLAB does if anything with the output from
system('cmd&')
; I suspect you'll need to find a different way to solve this problem.â thrig
Nov 19 '17 at 17:33
Perhaps you can add
>&/dev/tty
to the mpiexec command to make it output to the terminal.â meuh
Nov 19 '17 at 17:44
@meuh It didn't work. Still no output in terminal. Output works fine if I direct it to a logfile though...
'.... ./<program2> > logfile 2>&1 &'
â Moody
Nov 19 '17 at 18:53