gtkdialog gui seperate buttons use seperate functions in their GUI. A variable \(newFolderName\) is being set in one function \(funcA\) and it needs to be called in another function \(funcB\). I thought using global variable \(like in python\) concept should work however it does not.
How else is it possible to do share variables between functions. ?
Will echo "Hello Singhai" and create a folder named "v01-Singhai"
When you define a variable prior to functions, that value will be used.
However, if you define a variable with the same name within a function, that value will remain inside the function.
Not sure if 'special' shopt settings are required or if its regular behaviour.
Last login: Sun Jan 26 09:38:30 on ttys000
AMIGA:barrywalker~> FuncA() { text="This is function A with a variable..."; }
AMIGA:barrywalker~> FuncB() { eval $1; echo "$text"; }
AMIGA:barrywalker~> FuncB FuncA
This is function A with a variable...
AMIGA:barrywalker~> _