Hello all, I am i am trying to read username password. Bassicaly, i have file called sidlist and it has my database name, username and password....
looks something like this....
db1, user1, pass1
db2, user2, pass2
db3, user3, pass4
but i dont know how to make it work, until i get rid of user1 and pass1...like below...and only have db1 (database name)...to login to sqlplus...
how can read the parameter2 (username) and parameter3(password) and pass that in a loop ??
$ cat test.sh
###########################
# Check for the oratab file.
###########################
ORATAB=/etc/oratab
##now cat for sid list
for ORACLE_SID in `cat /home/oracle/sidlist`
do
################################################
# Build list of distinct Oracle Home directories.
################################################
OH=`egrep -i ":Y|:N" $ORATAB |grep $ORACLE_SID| grep -v "^#" | grep -v "\*" | cut -d":" -f2 | sort | uniq`
echo $ORACLE_SID
echo $OH
#############################
# Set the Oracle environment.
##############################
ORAENV_ASK=NO
export ORACLE_SID
. oraenv
which sqlplus
echo '#####################################################################################'
done
$
$
$
$ cat sidlist
test
mihran
$
i found this below link...that gives me a idea how to use it....but then how would i use that in a loop ??
https://www.unix.com/shell-programmin...ass-shell.html