bash global variable in loop code example
Example: assign global variable inside loop bash
The while-loop is executed in a subshell, so changes to the variable
inside the while-loop won't affect the external variable.
The while-loop is executed in a subshell, so changes to the variable
inside the while-loop won't affect the external variable.