2025-03-14 21:59:59 -06:00
|
|
|
# let
|
|
|
|
|
|
|
|
|
|
> Evaluate arithmetic expressions in shell.
|
|
|
|
|
> Supports variables, operators, and conditional expressions.
|
2025-12-16 10:20:31 -07:00
|
|
|
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-let>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- 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`
|