[HPADM] Processing variable number of arguments in ksh scripts:

From: Abramson, Stuart (SAbramson_at_Wabtec.com)
Date: 10/24/03

  • Next message: Sabrina Lautier: "[HPADM] Download patch"
    To: "Hpux-Admin (E-mail)" <hpux-admin@dutchworks.nl>
    Date: Fri, 24 Oct 2003 11:09:37 -0400
    
    

    hpux-admins:

    I want to process a variable number of arguments to a ksh script one at a
    time:

            ksh script.ksh arg1 agr2 ... argN

    where:

            ##
            # script.ksh
            #

            for each argument
            do
                    symdev -sid -XXX -sa 03b write_disable $ARGX -noprompt
            done

    where $ARGX is each argument 1 to N one at a time.

    How does one do that?

    I don't know how many there will be at each call. There must be one
    minimum.

    I think you do this with "shift", somehow....

            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: Sabrina Lautier: "[HPADM] Download patch"