[HPADM] Matching/substituting two strings in ksh ??

From: Abramson, Stuart (SAbramson_at_Wabtec.com)
Date: 11/25/03

  • Next message: Abramson, Stuart: "[HPADM] Splitting Oracle DataBases "Live" with EMC TimeFinder/BCV "symioc tl" commands"
    To: "Hpux-Admin (hpux-admin@dutchworks.nl)" <hpux-admin@dutchworks.nl>
    Date: Tue, 25 Nov 2003 14:05:26 -0500
    
    

    Hpux-admins:

    I have two "variable strings" in a ksh script:

            OLD_MPS="/u1001 /u1101 /u1102 /u1201 . . . /uXYYY"
            NEW_MPS="/u2001 /u2101 /u2102 /u2201 . . . /uZQQQ"

    I want to go through a mounted directory, and, respectively, for every
    occurrence of:
            /u1001 replace it with /u2001
            /u1101 replace it with /u2101

    I don't want to replace "/u1" with "/u2". I actually want to replace the
    1st occurrence in the "OLD_" list with the 1st occurrence in the "NEW_"
    list, the 2nd with the 2nd, the 3rd with the 3rd, etc.

    My problem is not the outside loop, but the inside:

            for OMP in $OLD_MPS
            do
                    echo $OMP
                    # match with $NMP in $NEW_MPS

    Can I turn my original variable strings into arrays? Then I could match
    OLD_MPS[0] with NEW_MPS[0], etc. How would I do that?

                    Stuart

    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)
    

  • Next message: Abramson, Stuart: "[HPADM] Splitting Oracle DataBases "Live" with EMC TimeFinder/BCV "symioc tl" commands"