Files
cheatsheet-tldr/tldr/linux/let
2024-11-23 00:18:45 +00:00

27 lines
511 B
Plaintext

---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# let
> Evaluate arithmetic expressions in shell.
> Supports variables, operators, and conditional expressions.
> More information: <https://manned.org/let>.
- 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`