((...))

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Increment an Integer

local i=0
((i++))

Decrement an Integer

local i=1
((i--))

Organizatorium

Display the value of the variable, then increment it:

i=0
echo $((i++))
echo ${i}

displays:

0
1

Increment the value of a variable, then display t:

i=0
echo $((++i))
echo ${i}

displays:

1
1