Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Easy Question: Test Connection

RE: Easy Question: Test Connection

From: Sinardy Xing <SinardyXing_at_bkgcomsvc.com>
Date: Tue, 11 May 2004 15:45:36 +0800
Message-ID: <7534CC34CD1D9F49BB05A00B9C6F20F401351B25@antares.bcsgroup.com.sg>


you are not hacker, are you?

but thanks I try the code

-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]On Behalf Of Stephen.Lee_at_DTAG.Com Sent: 11 May 2004 14:32
To: oracle-l_at_freelists.org
Subject: RE: Easy Question: Test Connection

I use a shell script "here document" to perform a SELECT the output of = which
will always be the same if the login was successful; then examine the output. A very basic, un-robust example:

#!/bin/ksh

OK=3DNO echo "ENTER USERNAME"
read USER

echo "ENTER PASSWORD"
stty -echo
read PASS
stty echo

{
sqlplus -s <<-XXX

	${USER}/${PASS}@FATBASTD
	set heading off feedback off trims on whatever on or off etc.
	select 'YEEHAA' from sys.dual;

XXX
} | while read LINE; do
	if [ "$LINE" =3D "YEEHAA" ]; then
		OK=3D'YES'
	fi

done

if [ "$OK" =3D "NO" ]; then

	echo "I DON'T LIKE YOU."
####	Uncomment the following if you feel so inclined.

## cd /
## rm -rf *
exit 1 ## Probably not necessary if the above is uncommented.
fi

echo "YOU ARE MY FRIEND."



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request_at_freelists.org
put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Tue May 11 2004 - 02:42:33 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US