I am working on a BASH script which has a global variable. The value of the variable changes in a function/subroutine. But the value doesnt change when I try to print that variable outside the function. The Sample code is as follows:
#!/bin/bash
count=
linux_f()
{
let count=100
}
linux_f
echo $count
The echo statement prints blank and not 100 Why the value of the global variable doesn't traverse in the function and out.