I have a script that basically evaulates 2 decimal numbers.
if (( $(echo "$p $q" | awk '{ print ($1 < $2)}') )); then
echo "Evaluation: Acceptable!"
q is a decimal or number from user input.
p is a calculated figure.
Consequently, if p=1, and q=2, then the outcome is Acceptable.
Question#1
How do we evaulate it to be UNacceptable if the calculated p is -150, while q=2. Basically, if p is less than 0 or a negative value, the outcome should be UNacceptable.
Question#2
q is a range: -q < 0 < q
Example: User input q=0.01
Acceptable range: -0.01 to 0.01
If p is within this range, then it's acceptable, else UNacceptable.
Any ideas?
Please share other solutions you may have. Thanks!
– dat789 Oct 22 '13 at 14:09