On Dec 27, 2007, at 8:22 , Kristis Makris wrote:
Because the OUTPUT variable was left blank, hence the shell executed:
if [ = 1 ]; then
...
which is invalid.
I suspect OUTPUT remained blank due to a problem with the 'wc'
utility on the Mac. Can you look into it ?
I've looked into it. OUTPUT isn't blank, it has leading whitespaces.
Script below produces:
-----------
1
1
PASSED
-----------
Trimming the output works for me. Shall we apply trimming to all
'install_glue_wrong_ip.sh' tests?
---SNIP---
#!/bin/sh
OUTPUT=`echo "Unable to connect to integration daemon ..." | grep -i
'Unable to connect to integration daemon' | wc -l`
echo "1"
echo "$OUTPUT"
OUTPUT=`expr "$OUTPUT" : '[[:space:]]*\(.*\)[[:space:]]*$'`
if [ "$OUTPUT" = "1" ]; then
echo PASSED
else
echo FAILED
fi
---SNAP---
_______________________________________________
scmbug-users mailing list
[email protected]
http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users