I am looking for the better coding to re-assign value to a shell variable, but not simply overwirte.
For example:
var=2
{code block}
var=3 ### I don't want to simply overwirte var
### Instead
: ${var:=3}
{other code}
Is that the out-of-date style? Are there better ways to do it?
Many thanks.
For example:
var=2
{code block}
var=3 ### I don't want to simply overwirte var
### Instead
: ${var:=3}
{other code}
Is that the out-of-date style? Are there better ways to do it?
Many thanks.