nv-l

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

2002-04-24 10:52:40
Subject: Re: [nv-l] searching character string in a variable
From: "Oliver Bruchhaeuser" <oliver.bruchhaeuser AT de.ibm DOT com>
To: "'nv-l AT lists.tivoli DOT com'" <nv-l AT lists.tivoli DOT 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 AT de.ibm DOT 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 AT lists.tivoli 
DOT com'" <nv-l AT lists.tivoli DOT com>                                        
   
                      <D.D'Apice AT SAQ DOT 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 AT saq.qc DOT ca
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: nv-l-unsubscribe AT lists.tivoli DOT com
For additional commands, e-mail: nv-l-help AT lists.tivoli DOT 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>