From 341af9341771d5f93c52185706e77cee4fc29ded Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 19 Sep 2019 11:58:40 +0300 Subject: [PATCH] docs: update --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 3813673..3a57943 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,8 @@ A collection of pure POSIX `sh` alternatives to external processes * [Bitwise](#bitwise) * [Logical](#logical) * [Miscellaneous](#miscellaneous) +* [ARITHMETIC](#arithmetic-1) + * [Ternary Tests](#ternary-tests) @@ -506,3 +508,15 @@ For use in `[ ]` `if [ ]; then` and `test`. | --------- | ---------------- | ------- | | `,` | Comma Separator | `((a=1,b=2,c=3))` + +# ARITHMETIC + +## Ternary Tests + +```shell +# Set the value of var to var2 if var2 is greater than var. +# 'var2 > var': Condition to test. +# '? var2': If the test succeeds. +# ': var': If the test fails. +var=$((var2 > var ? var2 : var)) +```