nv-l

[nv-l] [ksh] searching character string in a variable

2002-04-24 10:10:01
Subject: [nv-l] [ksh] searching character string in a variable
From: "Davis, Donald" <donald.davis AT firstcitizens DOT com>
To: "'D'Apice, Dominic'" <D.D'Apice AT SAQ.qc DOT ca>, "'nv-l AT lists.tivoli DOT com'" <nv-l AT lists.tivoli DOT com>
Date: Wed, 24 Apr 2002 10:10:01 -0400

Dominic,
Try this:

echo $alert | grep  "rule 11"
if [[ $? = 0 ]] ; then
     do something if found
fi

Don
=======================
Donald Davis
First Citizens Bank
Systems Engineer Consultant
Enterprise Management
100 East Tryon Road
Mail Code: DAC 22
Raleigh, NC.  27603-3526

-----Original Message-----
From: D'Apice, Dominic [mailto:D.D'Apice AT SAQ.qc DOT ca]
Sent: Wednesday, April 24, 2002 9:42 AM
To: 'nv-l AT lists.tivoli DOT com'
Subject: [nv-l] searching character string in a variable


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)

------------------------------------------------------------------------------
This electronic mail and any files transmitted with it are confidential and are intended solely for the use of individual or entity to whom they are addressed. If you are not the intended recipient or the person responsible for delivering the electronic mail to the intended recipient, be advised that you have received this electronic mail in error and that any use, dissemination, forwarding, printing, or copying of this electronic mail is strictly prohibited. If you have received this electronic mail in error, please immediately notify the sender by return mail.

==============================================================================

<Prev in Thread] Current Thread [Next in Thread>
  • [nv-l] [ksh] searching character string in a variable, Davis, Donald <=