DSKUSDPERCENT=$(($DISKUSD * 100 / $limit))
throws an error like
syntax error: operand expected (error token is "/ ")
where limit=$OPTARG defined in Process command line options
Here I am not able to get the value of $limit
DSKUSDPERCENT=$(($DISKUSD * 100 / $limit))
throws an error like
syntax error: operand expected (error token is "/ ")
where limit=$OPTARG defined in Process command line options
Here I am not able to get the value of $limit
Check $limit
value:
$ DISKUSD="1000"
$ limit="100"
$ echo $(($DISKUSD * 100 / $limit))
1000
$ limit=''
$ echo $(($DISKUSD * 100 / $limit))
bash: 1000 * 100 / : syntax error: operand expected (error token is "/ ")
So, it is likely that $limit
is empty, so that the expression becomes something like $((666 * 100 / ))
, which is, of course, invalid.
where limit=$OPTARG
Well, either there's no command line option for limit is provided, or there's some mistake in processing arguments.