I want to define a constant inside a function that could be used outside the function's scope.
function section {
variable = "Hello"
}
echo variable
Is this possible?
I want to define a constant inside a function that could be used outside the function's scope.
function section {
variable = "Hello"
}
echo variable
Is this possible?
its already there for you to use. try to run it and see. Remember, no spaces between "=" sign when assigning variables
$ function section { variable="Hello"; }
$ section
$ echo $variable
Hello