unix Ksh script variable
From: A Joshi <ajoshi977_at_yahoo.com>
Date: Sun, 30 Jan 2011 19:55:04 -0800 (PST)
Message-ID: <770572.52317.qm_at_web57505.mail.re1.yahoo.com>
hi
I have a script which is to be executed on many databases and different databases have different log in users/password. Login needs to be chosen based on parameter passed so if the parameter passed is 1 it needs to choose user1 and so on. I will be doing sqlplus $usr_at_$DB and need usr to have the value sys in this case and so on it is something like -
pw2=xx
pw3=xxx
#number=$1
number=1
us=user
usr=$us$number
export user1 user2 user3 number us usr
export pw1 pw2 pw3
echo $user1
I tried in below ways but it is not working echo $usr
export $usr ="$user1"
echo $usr
echo `echo $"$usr"`
can someone help.thanks in advance
Date: Sun, 30 Jan 2011 19:55:04 -0800 (PST)
Message-ID: <770572.52317.qm_at_web57505.mail.re1.yahoo.com>
hi
I have a script which is to be executed on many databases and different databases have different log in users/password. Login needs to be chosen based on parameter passed so if the parameter passed is 1 it needs to choose user1 and so on. I will be doing sqlplus $usr_at_$DB and need usr to have the value sys in this case and so on it is something like -
user1=sys user2=system user3=emp pw1=x
pw2=xx
pw3=xxx
#number=$1
number=1
us=user
usr=$us$number
export user1 user2 user3 number us usr
export pw1 pw2 pw3
echo $user1
I tried in below ways but it is not working echo $usr
export $usr ="$user1"
echo $usr
echo ${!$usr} echo ${!usr} echo $"$usr"
echo `echo $"$usr"`
can someone help.thanks in advance
-- http://www.freelists.org/webpage/oracle-lReceived on Sun Jan 30 2011 - 21:55:04 CST