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 -->
  #5 (permalink)  
Old 02-20-2007
vino's Avatar
vino vino is offline
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,710
Quote:
Originally Posted by hsekol
example

File1 Code:

. file2.ksh
tmp=1
fn_test $tmp

File2 Code:

fn_test()
{
echo $tmp
}
echo test

here the output will be

1
test

where i want only the value present in that function, i don;t want the code present outside of that function to execute
If you can make File2 to contain functions and only functions, then the code in File1 would be fine.
Something like
Code:
    fn_test()
    {
          echo $tmp
    }
    fn_echo ()
    {
          echo test
    }
Reply With Quote