Tuesday, 15 September 2015

linux - Why does "expr $n - 1" work, but "expr $n -1" doesn't? -


I have a small problem if you want both of the test script here is a job

  #! / Bin / bash N = 40 while echoing to ["$ N" -gt 0] = $ NN = `expr $ N - 1` done  

This does not work anymore

  #! / Bin / bash n = 40 while ["$ N" -gt 0] do $ NN = $ expr $ N -1 'done  

The problem looks like this line N

bash, version 4.2.45 (1) -release (x86_64-redhat-linux- Gnu)

- 1 Two words are -1 One word is $ N - 1 An expression is $ N -1 with no two predictions.

Do you know what to do, okay?


No comments:

Post a Comment