The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 08-22-2007
prez prez is offline
Registered User
 

Join Date: Aug 2007
Posts: 7
return value of a function

Hi
I have a doubt in the way the variables inside a function are treated .
if a function is called from the main script directly, the variables inside them act as global variables.
however if the return value of the function is stored to some other variable in the main script as shown,
x=`some_function $some_args`
then all the variables in the function become local ones. they are not relected in the main script.

thnx in advance....
Reply With Quote
Remove advertisements
!!
Forum Sponsor