3 ms·
Is this a bash-ism? "$x plus $y equals $((x+y))"
by panzi 2y ago
Is this a bash-ism?
"$x plus $y equals $((x+y))"
- jonahx 2y agoThis works in "sh" as well for me.
- jwilk 2y agoNo, it's portable shell syntax.
- LukeShu 2y ago"$((" arithmetic expansion is POSIX (XCU 2.6.4 "Arithmetic Expansion"). But if I'm not mistaken, it originated in csh.
- susam 2y ago> Is this a bash-ism? > "$x plus $y equals $((x+y))" No, it is specified in POSIX: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_04 https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V...