Starting another program that shares output terminal with current program?

The name of the pictureThe name of the pictureThe name of the pictureClash 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?







share|improve this question






















  • 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














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?







share|improve this question






















  • 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












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?







share|improve this question














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?









share|improve this question













share|improve this question




share|improve this question








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 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
















  • 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















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















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















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



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














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













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay