hello.
why the counter in the example is not increasing???
Code:
$ cat testscpt.ksg
A1=$1
A2=$2
ERRCOUNT=0
[[ ! -z $A1 ]] && echo V1 :: $A1 || ( echo "V1 :: CHECK IT!!!" ; ((ERRCOUNT+=1)) )
echo after A1 ERRCOUNT = $ERRCOUNT
[[ ! -z $A2 ]] && echo V2 :: $A2 || ( echo "V2 :: CHECK IT!!!" ; let ERRCOUNT+=1 )
echo after A2 ERRCOUNT = $ERRCOUNT
$
$
$
$
$
$ ./testscpt.ksg
V1 :: CHECK IT!!!
after A1 ERRCOUNT = 0
V2 :: CHECK IT!!!
after A2 ERRCOUNT = 0
$
$
$ ./testscpt.ksg 1
V1 :: 1
after A1 ERRCOUNT = 0
V2 :: CHECK IT!!!
after A2 ERRCOUNT = 0
$
$ ./testscpt.ksg 1 2
V1 :: 1
after A1 ERRCOUNT = 0
V2 :: 2
after A2 ERRCOUNT = 0
$