07-16-2011
how would i read the password in a loop then...how would i read the diff password in a loop then ?? obviously one at a time...
db1, user1, pass1
db2, user2, pass2
as of now...my script looks like this...but it only works...as i have user1 hardcoded in it...its not ussing pass1, pass2 for each db....
$ cat test.sh
user1=system/abc123
###########################
# Check for the oratab file.
###########################
ORATAB=/etc/oratab
##now cat for sid list
for ORACLE_SID in `cat /home/oracle/sidlist|awk -F, '{print $1}'`
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
sqlplus /nolog << EOF
connect $user1
@test.sql
EOF
echo '#####################################################################################'
done
$
$
$
$ cat sidlist
test, pass1
mihran, pass2
$
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Can we write a script to telnet to a unix server from unix with the username and password hardcoded in the script??
something like ssh a@b -p password ??? (5 Replies)
Discussion started by: roshanjain2
5 Replies
2. Shell Programming and Scripting
Dear All
I am trying to write one shell which will be running through Cron which contain one SQL query. But I want to draw/fetch the Username password and Instance name (required to loging to the database) from one single file to run that SQL query . Also this file contain details of multiple... (2 Replies)
Discussion started by: jhon
2 Replies
3. Shell Programming and Scripting
Hi, Guys
I am new to shell programming and just get stuck with one simple question. please kindly help.
According to the tutorial here, we can do something like
for NODE in "ABC 10" "EFG 20"
do
set -- $NODE
echo "letter is $1, number is $2"
done
And the result will... (3 Replies)
Discussion started by: yuanli
3 Replies
4. UNIX for Dummies Questions & Answers
hi all,
i run sqlplus command on unix(HP-UX)
like "sqlplus username/password@serverA @deneme.sql"
but when someone run "ps -ef | grep sqlplus", it can see my username and password :(
How can i hide username and password.
thanx. (1 Reply)
Discussion started by: temhem
1 Replies
5. Shell Programming and Scripting
Hi all,
I would like to simply read a file which lists a number of pathnames and files, then search and replace key strings using a few vi commands:
:1,$s/search_str/replace_str/g<return>
but I am not sure how to automate the <return> of these vis commands when I am putting this in a... (8 Replies)
Discussion started by: cyberfrog
8 Replies
6. UNIX for Advanced & Expert Users
Hi All,
I want to login to a server through SFTP by giving username and password, in an automated script.
I know that this can be done through public key authentication, but my requirement is to login ONLY through username and password.
I am using GNU/Linux server.
Please advise me !!!... (4 Replies)
Discussion started by: sparks
4 Replies
7. Shell Programming and Scripting
Hi,
Whenever I open my unix box,after providing username and password I get the following message.
Are you authorised to use this computer as detailed above? (Y)es/(N)o : y
Export: Release 10.2.0.2.0 - Production on Mon May 16 16:00:15 2011
Copyright (c) 1982, 2005, Oracle. All rights... (5 Replies)
Discussion started by: emilybose
5 Replies
8. Shell Programming and Scripting
Hi
I am new to using unix and am struggling with a script i am writing. What i am trying to do is get a user to enter a username, check the original file i created with username and pin to see if their is a corresponding entry. Next ask the user to enter the pin and see if this matches... (5 Replies)
Discussion started by: somersetdan
5 Replies
9. UNIX for Dummies Questions & Answers
Picked up a 3b2 running System V. Works fine, but it requires a username and password. Is the username "root" or "sysadm"? How do I find out and how to I reset it or bypass it?
Thanks. (2 Replies)
Discussion started by: TanRuNomad
2 Replies
10. Shell Programming and Scripting
Hi,
I have a variable which stores file names as a result of find command. I need to delete all these files one by one, i.e. by a loop. Can anyone tell me how can it be done?
The variable f2d has the file names like these
abc.txt
bcd.txt
fff.txt
gef.txt
Now I have used a loop as... (12 Replies)
Discussion started by: jhilmil
12 Replies
LEARN ABOUT OSX
dsenableroot
dsenableroot(8) BSD System Manager's Manual dsenableroot(8)
NAME
dsenableroot -- enables or disables the root account.
SYNOPSIS
dsenableroot [-d] [-u username] [-p password] [-r rootPassword]
DESCRIPTION
dsenableroot sets the password for the root account if enabling the root user account. Otherwise, if disable [-d] is chosen, the root
account passwords are removed and the root user is disabled.
A list of flags and their descriptions:
-u username
Username of a user that has administrative privileges on this computer.
-p password
Password to use in conjunction with the specified username. If this is not specified, you will be prompted for entry.
-r rootPassword
Password to be used for the root account. If this is not specified for enabling, you will be prompted for entry.
EXAMPLES
-dsenableroot
Your username will be used and you will be queried for both your password and the new root password to be set to enable the root
account.
-dsenableroot -d
Your username will be used and you will be queried for only your password to disable the root account.
-dsenableroot -u username -p userpassword -r rootpassword
The supplied arguments will be used to enable the root account.
-dsenableroot -d -u username -p userpassword
The supplied arguments will be used to disable the root account.
Mac OS August 08 2003 Mac OS