I am new to shell scripting and I need some help on the following problem:
I have script. It has a global variable defined as follows:
ARCHIVE_USER=user1
Then, in a method, I am changing the values for these variables:
test_function(){
ARCHIVE_USER=user2
test_function2()
}
test_function2(){
echo ARCHIVE_USER
}
I want test_function2 to print "user2" instead of "user1" because in the test_function I have renamed the variable value to "user2", but when I run it, it is always giving me "user1" as the output. What am I doing wrong here?