Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Korn Shell Q
I have a shell script called exfail.sh which checks for potential extent
failures on a database. The script accepts a couple of command line
switches.
exfail.sh -p -g "dba apps" TEST
Basically this says run the exfail.sh script against the "TEST" instance,
(-p) page people if there are problems, (-g) send the page/email to everyone
in the "dba" and "apps" group.
This works just fine. I have another script which rolls through the oratab file and calls exfail.sh against every database on the host.
check_all_exfail.sh
The scripts sources in some environment files which set up the command line parameters for the host or database.
EXFAIL_OPTIONS="-p -g \"dba apps\""
When I run "set -x" in the script I can see the call from check_all_exfail.sh to exfail.sh is correct just like the first example.
exfail.sh -p -g "dba apps" TEST exfail.sh -p -g "dba apps" DEV exfail.sh -p -g "dba apps" FOO
However the exfail.sh script parses the command line in an entirely different manner. The -g switch picks up
"dba
as the $OPTARG and not
dba apps
thus
apps"
becomes the $1 argument instead of the correct
TEST
I know I need to tell the check_all_exfail.sh file to parse the line twice
(I think) bit I can't remember the command off had to do this. Anyone have
some ideas for me to try?
Thanks,
Ethan
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Post, Ethan INET: Ethan.Post_at_ps.net Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-LReceived on Tue Mar 05 2002 - 22:23:19 CST
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
![]() |
![]() |