From 4df55c67edebfaf6cfcb19b4e8a6e27dac8b3d9d Mon Sep 17 00:00:00 2001 From: Shou-Chi Chen <87609690+jackiesogi@users.noreply.github.com> Date: Fri, 22 Nov 2024 09:07:27 +0800 Subject: [PATCH] let: add page (#14616) * let: add page * Update pages/linux/let.md Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com> * Update pages/linux/let.md Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com> * Update pages/linux/let.md Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com> * Update pages/linux/let.md * add --help example Co-authored-by: Wiktor Perskawiec --------- Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com> Co-authored-by: Nelson Figueroa <30811275+nelsonfigueroa@users.noreply.github.com> Co-authored-by: Wiktor Perskawiec --- pages/linux/let.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 pages/linux/let.md diff --git a/pages/linux/let.md b/pages/linux/let.md new file mode 100644 index 000000000..8754e44ee --- /dev/null +++ b/pages/linux/let.md @@ -0,0 +1,21 @@ +# let + +> Evaluate arithmetic expressions in shell. +> Supports variables, operators, and conditional expressions. +> More information: . + +- Evaluate a simple arithmetic expression: + +`let "{{result = a + b}}"` + +- Use post-increment and assignment in an expression: + +`let "{{x++}}"` + +- Use conditional operator in an expression: + +`let "{{result = (x > 10) ? x : 0}}"` + +- Display help: + +`let --help`