[cfe-dev] Trying to understand some test "... 2>&1 >/dev/null | ..."

Nuno Lopes nunoplopes at sapo.pt
Tue Aug 11 14:39:50 PDT 2009


> There is a bunch of failures caused by this kind of tests on windows, such
> as Preprocessor\include-directive1.c. Here an example of a test command:
> // RUN: clang-cc -E %s -fno-caret-diagnostics 2>&1 >/dev/null | grep 'file
> successfully included' | count 3
>
>>From what I understand, first stderr is redirected to stdout and then 
>>stdout
> to /dev/null, meaning if I understand thing well that both stderr and 
> stdout
> goes into /dev/null and are not passed to the next process in the pipe. So
> what it supposes to go in the following pipe? Obviously there is something 
> I
> don't know...

nops. that means that stderr is passed through the pipe and stdout is 
discarded. The forwarding of fds is done in the specified order (and it 
matters).
Nuno 




More information about the cfe-dev mailing list