simple unix question [message #63272] |
Thu, 23 September 2004 07:16 |
sidd
Messages: 130 Registered: May 2003
|
Senior Member |
|
|
I have something like this
Cat Myfirst.ksh
. /somepath/myoriginal.ksh aaa # here aaa is the parameter
# end of the script
now, in one of my scripts I have some like this
cat mysecd.ksh
. /somepath/myfirst.ksh
myvar=$1
echo $myvar
# whatever done from here
# end of the script
here is what I am trying, when I run the mysecd.ksh as follows
. /mysecd.ksh bbb # here bbb is the argument I am passing to mysecd.ksh script
I get aaa not bbb. I want bbb as myvar value. Hope you guys understand.
Thank you
sidd
|
|
|
Re: simple unix question [message #63293 is a reply to message #63272] |
Fri, 24 September 2004 05:36 |
manoj rattan
Messages: 3 Registered: September 2004
|
Junior Member |
|
|
You are not passing the parameter from one script to the other.
Make the following changes
mysecd.ksh should look like
# Begin mysecd.ksh script
myvar=$1
echo $myvar
. /somepath/myfirst.ksh $myvar
# whatever done from here
# end of the mysecd.ksh script
Myfirst.ksh should be as follows
# Start of the Myfirst.ksh script
aaa=$1
. /somepath/myoriginal.ksh aaa # here aaa is the parameter
# end of the Myfirst.ksh script
Hope this helps.
|
|
|