07-24-2009
Hi jhon
DBLIST=`egrep -i ":Y|:N" /etc/oratab | cut -d":" -f1 | grep -v "\#" | grep -v "\*"`
for DBNAME in $DBLIST
do
username=`grep $DBNAME DBCONFIG.cfg | cut -d "|" -f2`
password=`grep $DBNAME DBCONFIG.cfg | cut -d "|" -f3`
sqlplus -s ${username}/${password} <<EOF
select name from v\$database;
select sysdate from dual;
EOF
done
scripter
Last edited by Franklin52; 07-24-2009 at 05:30 PM..
Reason: urls removed
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Anyone can help me ?
I try to using crontab with a simple shell script as echo it run okay but now i have more command in script. when I set entry to crontab and whe it run i get mail with error cannot execute binary file.
it urgent so please help me the soutions. Thank so much for your help.... (5 Replies)
Discussion started by: raccsdl
5 Replies
2. Shell Programming and Scripting
Hi
I am doing a process of converting all the values of key column into a row, for eg
Key col1 col2
1 1 1
1 2 1
1 1 3
1 3 1
2 ... (2 Replies)
Discussion started by: nvuradi
2 Replies
3. AIX
hi there,
Please help me
How transfer sql file from one server to another without username and password .i know just IP address.
Thanks
Arpit (1 Reply)
Discussion started by: Arpitmitm
1 Replies
4. 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
5. UNIX for Advanced & Expert Users
Hi,
I am running the following command, and it tries to delete some dn from ldap, however, it takes lot of time before it finally request LDAP server to delete it.
I am trying to find why it is taking lot of time. Could you anyone help me in this regard. I have copies the pstack output, and... (3 Replies)
Discussion started by: john_prince
3 Replies
6. Shell Programming and Scripting
Hi All,
I am writing a script where it updates a file in an unix account.
To update that file i need to be logged in as that account user.
say account name is ab01 and its password is passab01.
What i want to do is, my script should read login id and password from a parameter file and... (4 Replies)
Discussion started by: pkbond
4 Replies
7. Shell Programming and Scripting
Hi,
I need to query Oracle database for 100 users. I have these 100 users in a file. I need a shell script which would read this User file (one user at a time) & query database.
For instance:
USER CITY
--------- ----------
A CITY_A
B CITY_B
C ... (2 Replies)
Discussion started by: DevendraG
2 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. Shell Programming and Scripting
Hello All,
I have created a shell script, When i run it manually as ./<script_name> it takes 5 hours to run, but when i am scheduling it in crontab, it is taking 20 hours to run.
Please help me and advice, what can be done to reduce the time in crontab.
Thank you (6 Replies)
Discussion started by: anand2308
6 Replies
10. Shell Programming and Scripting
Hokay...first post, and I have been doing Linux scripting for a total of 2 days now. I think I am doing pretty well, but awk and arrays(what I think I need here) is a bit above me so far.
I have written a script that will take and either create or modify 5 users, and passwords.
It checks... (6 Replies)
Discussion started by: cashman04
6 Replies
LEARN ABOUT DEBIAN
shunit2
SHUNIT2(1) SHUNIT2(1)
NAME
shunit2 - A unit test framework for shell scripts
SYNOPSIS
shunit2 unitfile
DESCRIPTION
shUnit2 is a xUnit unit test framework for Bourne based shell scripts, and it is designed to work in a similar manner to JUnit, PyUnit,
etc.. If you have ever had the desire to write a unit test for a shell script, shUnit2 can do the job.
You can either run shunit2 directly from the commandline and specify the unit file or directly source the shunit2 executable.
If you directly execute shunit2 and don't specify a unitfile shunit2 assumes a empty testfile and will return without an error message.
EXAMPLE
Simple script to test if 1 equals 1
#! /bin/sh
testEquality()
{
assertEquals 1 1
}
# load shunit2
. shunit2
Execute shUnit2 unit tests directly from the commandline
shunit2 /path/to/unit/file
OPTIONS
shunit2 does not support any commandline options at all. You can either source shunit2 to execute your unit tests or directly run shunit2
as a commandline script.
SEE ALSO
For more information see http://code.google.com/p/shunit2/ or have a look at the installed documentation in /usr/share/doc/shunit2/
AUTHOR
shunit2 was written by Kate Ward <kate.ward@forestent.com>. This manpage was written by Ulrich Dangel <mru@spamt.net>.
2.1.6 03/25/2012 SHUNIT2(1)