First run has failed with expr: non-integer argument
Code: Select all
testbox@printdemo ~
$ angle=25
testbox@printdemo ~
$ # compute crop of input into front and side
echo "sign=$sign"
xx=`expr $$ sign + 1`
testbox@printdemo ~
sign=`convert xc: -format "%[fx:$angle<0?0:1]" info:`
testbox@printdemo ~
$ echo "sign=$sign"
sign=1
testbox@printdemo ~
$ xx=`expr $sign + 1`
expr: non-integer argument
testbox@printdemo ~
$ echo $xx
testbox@printdemo ~
$
Second script run fine in shell and in a bash script.
Code: Select all
testbox@printdemo ~
$ angle=25
testbox@printdemo ~
$ # compute crop of input into front and side
testbox@printdemo ~
$ sign=`echo "$angle>0" | bc`
testbox@printdemo ~
$ echo "sign=$sign"
sign=1
testbox@printdemo ~
$ xx=`expr $sign + 1`
testbox@printdemo ~
$ echo $xx
2