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: Required Unix Shell Script.

Re: Required Unix Shell Script.

From: Jared Still <jkstill_at_gmail.com>
Date: Sat, 18 Sep 2004 10:43:41 -0700
Message-ID: <bf463804091810439da56c6@mail.gmail.com>


You don't appear to actually be using the '-p' switch. If you were you would likely want to investigate the use of the 'getopts' command.

This should work for the requirements given:

while [ ! -z $1 ]
do

        case $1 in
        pref|port|merge) echo $1;;
        *) echo "$1" - wrong value;exit 1;;
        esac
        shift

done

Jared

On Fri, 17 Sep 2004 12:31:45 -0400, Kumar, Dharminder <dharminder.kumar_at_bmonb.com> wrote:
> Hey all,
> I know this is Oracle DBA mailing list, but as I know that most of you guys=
> have excellent Unix shell scripting experience as well.
>
> I have the following problem.
>
> I need the shell script to do the following.=20
>
> start_rpt -p <perf port merge>
> {
> if 'perf' is paseed echo 'perf'
> if 'port' is passed echo 'port'
> if 'merge' is passed echo 'merge'
> if any other value is passed then echo 'wrong value'
>
> }
>
> So the program should be able to accept the parameter(s) for -p option and =
> it should be able to accept combination of values.
> Examples
>
> perf_rpt -p perf =3D=3D>should print
> perf
>
> perf_rpt -p perf port =3D=3D> should print=20
> perf
> port
>
> perf_rpt -p perf port merge =3D=3D> should print=20
> perf
> port
> merge
>
> and there are so many other combinations.
>
> Thank in advance.
> Dharminder Kumar
>
> <FONT SIZE =3D 1>**********************************************************=
> ******************
> This e-mail and any attachments may contain confidential and privileged inf=
> ormation. If you are not the intended recipient, please notify the sender i=
> mmediately by return e-mail, delete this e-mail and destroy any copies. Any=
> dissemination or use of this information by a person other than the intend=
> ed recipient is unauthorized and may be illegal. Unless otherwise stated, o=
> pinions expressed in this e-mail are those of the author and are not endors=
> ed by the author's employer.</FONT>
>
> --
> http://www.freelists.org/webpage/oracle-l
>

--
http://www.freelists.org/webpage/oracle-l
Received on Sat Sep 18 2004 - 12:39:18 CDT

Original text of this message

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