[HPADM] ksh test for pattern match ??

From: Abramson, Stuart (SAbramson@Wabtec.com)
Date: Thu Oct 02 2003 - 11:46:58 EDT


hpux-admins:

Is there a better way to do this?

I don't want any partial matches. Only exact matches to one case.

If there is a match, I process a bunch of stuff.

If there is no match, I exit with message.

        Stuart

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

SID_DG=$1
VALID_CASES=" bkx_al bkx_db bkx_tp
                rpx_al rpx_db rpx_tp"
MATCH="NO"

# Check for input request case match

for CASE in $( echo $VALID_CASES )
do
        if [[ $SID_DG = $CASE ]]
        then
                # We have a valid establish request
                MATCH="YES"
        fi
done

Stuart Abramson | Off: 412/825-1434 | Cell: 412/417-1567 | email:
sabramson@wabtec.com

***** CONFIDENTIALITY NOTE *****
The content contained in this e-mail transmission is legally privileged and confidential information intended only for the use of the individual or entity named herein. If the reader of this transmission is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this transmission is strictly prohibited.

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:34 EDT