Start subshell with different STDOUT

Hello
Before I get to my question let me explain the situation. I am writing a ksh script to startup several instances of an application. That is done by executing another ksh script (let's call it startApp) with some arguments. Now, startApp writes some information to stdout that I don't want displayed from my master script. However, it also redirects stdout to a log file and writes important information that is needed. When I try

startApp arg1 arg2 > SOME_FILE

in the master script, the log file is not created. I understand that when I execute startApp from within my script, startApp's subshell inherits stdin and stdout. Is there a way to execute startApp in a completely new shell that does not share stdout with the calling shell?
Thanks,

EvilBoz

I don't know about a new stdout, and this may be over simplified, but it may be the single > that may be overwriting the previous log entries. You could try

startApp arg1 arg2 >> SOME_FILE

This could easily be debugged by using

startApp arg1 arg2 | tee SOME_FILE

If your log ends up empty use

startApp arg1 arg2 | tee -a SOME_FILE

These will redirect the output to both stdout and the file. The difference is the "-a" appends the output. Same as the ">>" but echos to the screen as well.

Judging by your example. Unless StartApp has something that forks to a background process you should not run into trouble with stdout.

MPH

I tried using

startApp arg1 arg2 | tee SOME_FILE

but that had quite the opposite effect of what I need. It did create the log file but it also printed everything that was supposed to go to the log file to the screen. BTW, the only reason I was using

startApp arg1 arg2 > SOME_FILE

was to avoid anything being printed to the screen. SOME_FILE is either some temp file or /dev/null. The log file I need is created by startApp and not by the master startup script.
The problem is that either startApp or some other script it calls redirects stdout to the logfile. However, when I redirect output when I call startApp, the following redirects don't seem to have the desired effect.

I think I miss-read your initial post. I was under the impression that the log file was created by the redirect in the code example you gave initially.

With the assumtion that StartApp itself generates the log file. Which more than likely would be a printf to the file instead of a stdout redirect. Is it possible that the StartApp is directing the screen output to stderr instead of stdout? When you use:

startApp arg1 arg2 > SOME_FILE

does it still output to the screen? If this is the case in the master script you could try:

startApp arg1 arg2 > SOME_FILE 2>&1

If not I may need more info on what type of program it is to get a better idea of the problem. Just a thought.

MPH