The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 10-29-2008
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
Quote:
Originally Posted by indianjassi View Post
I have a shell script similar to:

#!/bin/sh
a=1
source a1.sh
-- Modifies a
source a2.sh
-- Modifies a
echo "After execution, value of a is $a"


What i need is a1.sh script modify the same variable a and same with a2.sh. Now the echo "After execution, value of a is $a" should print the value of a after manipulation in the scripts, and not 1 (value in calling script).
Is it possible?
It is possible and the steps you have shown are the right ones. Doesn't it work for you ?