2

While I'm searching for bash examples, I find the let command but I never understand it.

I saw the man bash, also I couldn't understand what let expression does.

Some let usage that I saw:

  • let z=z+3

  • let "z += 3"

What is the usage of let?

Any explained example will be appreciated.

4
  • 4
    I invite you to read unix.stackexchange.com/q/149823/38906
    – cuonglm
    Nov 6 '15 at 3:38
  • thank you ! so according to your question there , is let a="3 * (2 + 1)" replaces a=$((3 * $((2 + 1)))) , and is it meant to do only such job ?...
    – Yunus
    Nov 6 '15 at 3:44
  • They did the same job, and let is the same as ((...)). You should read Stephane answer unix.stackexchange.com/a/149916/38906 for more detail.
    – cuonglm
    Nov 6 '15 at 3:50
  • oh yeah i was reading it , and i got it ! many thanks bro :3
    – Yunus
    Nov 6 '15 at 3:57

Browse other questions tagged or ask your own question.