nv-l
[Top] [All Lists]

Re: [nv-l] searching character string in a variable

To: "'nv-l@lists.tivoli.com'" <nv-l@lists.tivoli.com>
Subject: Re: [nv-l] searching character string in a variable
From: "Oliver Bruchhaeuser" <oliver.bruchhaeuser@de.ibm.com>
Date: Wed, 24 Apr 2002 16:52:40 +0200
Dominic

there are several possibilities, for example:

if [ `echo $alert | grep "rule 11" ` ]
then
  echo "Found It"
fi

Kind regards

Oliver Bruchhaeuser
Tivoli NetView EMEA L2 Support

IBM Deutschland GmbH - ITS Tivoli - Dept. 7977 - Hechtsheimer Str. 2 -
55131 Mainz - Germany
Phone: +49-6131-84-5108 - Fax: +49-6131-84-6585 - email:
bruchhae@de.ibm.com

Need help with Tivoli Software Products?
Ask Tivoli!
http://www.tivoli.com/asktivoli (login with your customer account)


                                                                                
                                                                     
                      "D'Apice,                                                 
                                                                     
                      Dominic"                 To:       
"'nv-l@lists.tivoli.com'" <nv-l@lists.tivoli.com>                               
            
                      <D.D'Apice@SAQ.qc        cc:                              
                                                                     
                      .ca>                     Subject:  [nv-l] searching 
character string in a variable                                             
                                                                                
                                                                     
                      24.04.2002 15:41                                          
                                                                     
                      Please respond to                                         
                                                                     
                      "D'Apice,                                                 
                                                                     
                      Dominic"                                                  
                                                                     
                                                                                
                                                                     
                                                                                
                                                                     




Hello all, nv7.1 aix433

i need to do a ksh script who seach a string character in a variable

what is the sentence for that ? i mean like  :

 grep "rule 11" $alert...

i would like to do something like that :

if  ( grep "rule 11" $alert ) = 1 then  # if we found this string then do
instructions
  # instructions
end if

but the variable does'nt work like a file :  grep "rule 11" script.sh

it will be apreciated
> Dominic D'Apice
> Technicien informatique (OGEINF)
> Société des Alcools du Québec
> 2021 des futailles, Montréal Québec H1N 3M7
> * (514) 253-6015
> * D.D'Apice@saq.qc.ca
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: nv-l-unsubscribe@lists.tivoli.com
For additional commands, e-mail: nv-l-help@lists.tivoli.com

*NOTE*
This is not an Offical Tivoli Support forum. If you need immediate
assistance from Tivoli please call the IBM Tivoli Software Group
help line at 1-800-TIVOLI8(848-6548)





<Prev in Thread] Current Thread [Next in Thread>

Archive operated by Skills 1st Ltd

See also: The NetView Web