why does it still produce output in the third command?
$cat sh.sh
#!/bin/sh
echo $#
if [ $# > 0 ] ; then
base=`basename $1 .c`
echo $base
fi
$ sh sh.sh a.c
1
a
$ sh sh.sh
0
.c
I use this file:/usr/share/doc/opencv-doc/examples/c/build_all.sh to build the c examples for opencv packages,but failed with similar errors.
You need to use
-gtin place of>.You can use
>if you are using double parenthesis construct.