Skip to content
Joachim Ansorg edited this page Nov 12, 2021 · 2 revisions

(( )) doesn't support decimals. Use bc or awk.

Bash arithmetic conditional evaluation can only be performed on integers. More detail: Bash has limited data types which include integer, but everything is effectively untyped.

Suggested workarounds to this constraint use bc or awk, here are some examples.

Clone this wiki locally