how to calculate the minimum of two variables simply in bash? July 12, 2023 by Tarik If you mean to get MAX(4,$JOBS), use this: echo $((JOBS>4 ? JOBS : 4))