Hello,
I do have problem running our product testsuite on Solaris 11 Express. The 
testsuite uses this idiom:

check:
        @./hello|grep -v "Establish" > log
        @if cmp expected-output log >/dev/null; then : ; \
        else echo "FAILED:"; echo "===============================" ; \
        diff -u expected-output log ; \
        echo "==============================="; fi
        @rm -f log

^ this is a snipped of the Makefile of one of the tests. The test is run by 
`gmake check'. ./hello is test starting script which starts several of tests 
applications which communicate together. Now, the problem is that some of 
./hello started applications also prints something to the console. This 
something then needs to be filtered (by grep -v "Establish") and saved into the 
log file and compared with the expected result. Now, hello contains usual 
#/bin/sh at the beginning which means it's using ksh93 on Sol11Exp.

And now, when some application prints empty line, such line is discarded by the 
pipe before going to grep. Proof is simple:

$ cat test.sh 
#!/bin/sh
/usr/bin/echo line1
/usr/bin/echo
/usr/bin/echo line3
$ 

$ /bin/bash -c "./test.sh|grep -v "char""
line1

line3
$

$ /bin/sh -c "./test.sh|grep -v "char""
line1
line3
$ 

The output with bash is what's expected while the output with /bin/sh is wrong. 
Is that known issue or shall I report it?

Thanks,
Karel
-- 
This message posted from opensolaris.org
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to