Returning string values from a bash function
Ray Parrish
crp at cmc.net
Sun Nov 22 03:31:50 UTC 2009
Hello,
I need to know how to return a string value from a bash function. I
tried using "return $VariableName", and got the error that return
expected a numeric value.
So far I have been just operating on a variable declared before the
function call from within the function, i.e. global in scope to the
function itself, and that works, but I would like to know if I can
return the value of a variable that is local the the function.
In other words I would like to be able to make a call like the
following, and have it work.
SomeVariable=`MyFunction $Argument1`
or
SomeVariable=$( MyFunction $Argument1 )
Is this possible in bash?
Thanks, Ray Parrish
--
The Future of Technology.
http://www.rayslinks.com/The%20Future%20of%20Technology.html
Ray's Links, a variety of links to usefull things, and articles by Ray.
http://www.rayslinks.com
Writings of "The" Schizophrenic, what it's like to be a schizo, and other
things, including my poetry.
http://www.writingsoftheschizophrenic.com
More information about the ubuntu-users
mailing list