I have a variable containing a leading zeroes number, and I want to grep this variable and that same variable plus one. I made several attempts but ran into errors. Here's what I want to do:read varnewvar=$(($var +1))grep '$var' /some/dirgrep '$newvar' /some/dirI really think there's something wrong with my code. I also tried some test like this:#!/bin/bashecho enter numberread numbernewnumber=$(($number + 1))echo $newnumberThat gives me an error: value too great for base (error token is. If i do it like this: #!/bin/bashecho enter numberread numbernumber=newnumber=$(($number + 1))echo $newnumberThis will output 1 all the time.What's wrong with my attempts, and how can I do what I want?
grepping a variable and adding 1 to it
shell;grep;arithmetic