mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-01-26 11:33:59 +00:00
26 lines
488 B
Plaintext
26 lines
488 B
Plaintext
---
|
|
syntax: markdown
|
|
tags: [tldr, common]
|
|
source: https://github.com/tldr-pages/tldr.git
|
|
---
|
|
# let
|
|
|
|
> Evaluate arithmetic expressions in shell.
|
|
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-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`
|