Hi,
arithmetic evaluation should be done using (( )); check bash manpage /ARITHMETIC EVALUATION
know that bash doesn't deal at all with floating numbers, you'll have to use bc
Code:
nthreads=1 avproc=12
if (( $(bc <<<"$nthreads == 1.0") && ( avproc > 5 ) ))
then echo OK
else echo KO
fi
also, you could feed your array a simpler way:
Code:
array=( $( /usr/bin/sar -q 1 30 | awk '/Average/ {print $2,$3}' ) )
: no need to use grep with sed or awk
plus, you probably now have a file named 5
because > inside `test' (`[ ]') still means redirection!