Re: Separating stdout and stderr

Christophe Lyon <[email protected]>
Newsgroups gmane.comp.sysutils.dejagnu.general
Message-ID <CAKdteObTzme5t5-84LgQrf-SGKpodJ7bams+D41jU1G+AjzbkA@mail.gmail.com>
On 31 March 2016 at 16:11, Christophe Lyon <[email protected]> wrote:
> On 31 March 2016 at 12:20, Ben Elliston <[email protected]> wrote:
>> On Thu, Mar 31, 2016 at 12:11:59PM +0200, Christophe Lyon wrote:
>>
>>> But since we currently have "|&cat", we do redirect stderr, so the
>>> "and that standard error is not redirected" claude above is not
>>> fulfilled. Do you know what happens in this case?
>>
>> No, but I would suggest that it is cleaner and more portable to use
>> Tcl exec's own way of doing this:
>>
>> 2>@1
>>     Standard error from all commands in the pipeline is redirected to
>>     the command result. This operator is only valid at the end of the
>>     command pipeline.
>>
>> This is used like an option, before the actual command.
>>
>> Give that a go. It might work better.
>>
>
> I tried it, and saw no change in a small manual run.
>
> Anyway, as Maxim explained better, this is going to merge the
> 2 streams on the builder, not on the board which actually
> runs the test. So I think embedding the "2>&1" as part of
> command executed remotely is better.
>
> I need to check how I can run a full validation with this
> change in our environment.
>

For the record, I identified what caused several random results in
our setup. That's because we use 'ssh -tt' to access the remote tester.

The use of '-tt' was an attempt to workaround potential stdout/stderr
problems by forcing a remote testing environment as close as
possible to a native one.

Using 'ssh -t' seems to work better: the random results have disappeared.

I will run a few more tests to determine whether adding "2>&1" to
the remote command as discussed above is needed.

Thanks,

Christophe
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.