LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Syndicated Linux News (https://www.linuxquestions.org/questions/syndicated-linux-news-67/)
-   -   LXer: How to Increment and Decrement Variable in Bash (https://www.linuxquestions.org/questions/syndicated-linux-news-67/lxer-how-to-increment-and-decrement-variable-in-bash-4175659006/)

LXer 08-12-2019 01:51 AM

LXer: How to Increment and Decrement Variable in Bash
 
Published at LXer:

One of the most common arithmetic operations when writing Bash scripts is incrementing and decrementing variables. This is most often used in loops as a counter, but it can occur elsewhere in the script as well. Incrementing and Decrementing means adding or subtracting a value (usually 1), respectively, from the value of a numeric variable. In Bash, there are multiple ways to increment/decrement a variable. This article explains some of them.

Read More...


All times are GMT -5. The time now is 03:46 PM.