Results 1 to 2 of 2
  1. #1

    Exclamation Sh script.please help

    Hello, i need make this:

    mkdir /home/sites/site2/mysqlbakup
    chmod 777 /home/sites/site2/mysqlbakup
    chown httpd /home/sites/site2/mysqlbakup

    from site2 to site 220

    How can write sh script for make that in one step without write
    somthing like that:

    mkdir /home/sites/site2/mysqlbakup
    chmod 777 /home/sites/site2/mysqlbakup
    chown httpd /home/sites/site2/mysqlbakup

    mkdir /home/sites/site3/mysqlbakup
    chmod 777 /home/sites/site3/mysqlbakup
    chown httpd /home/sites/site3/mysqlbakup

    mkdir /home/sites/site4/mysqlbakup
    chmod 777 /home/sites/site4/mysqlbakup
    chown httpd /home/sites/site4/mysqlbakup


  2. #2
    Join Date
    Sep 2002
    code ;
    #set -x


    while [ "$SITE" != "220" ]

    do ((SITE=$SITE+1))

    echo "creating site$SITE " >>$LOG

    mkdir home/sites/site$SITE/mysqlbakup
    chmod 777/home/sites/site$SITE/mysqlbakup
    chown httpd/home/sites/site$SITE/mysqlbakup


    Disclaimer ;
    This is free advice and code. It is worth exactly what you paid for it. It is intended for reasonably competent sysadmins familiar with their machine and it's capabilities. No other warranty expressed or implied.Apply only to affected area. May be too intense for some viewers.All models over 18 years of age. If condition persists, consult
    your physician.Subject to change without notice.Edited for television. Keep cool; process promptly. Not
    responsible for direct, indirect, incidental or consequential damages resulting
    from any defect, error or failure to perform.Use only in a well-ventilated area. Keep away from fire or flames. Replace with
    same type. Approved for veterans. Booths for two or more. Check here if tax
    deductible. Some equipment shown is optional. Price does not include taxes. No
    Canadian coins. Not recommended for children. Pre-recorded for this time zone.
    Reproduction strictly prohibited. No solicitors. No alcohol, dogs or horses. No anchovies unless otherwise specified. Restaurant package, not for resale. List at least two alternate dates. First pull up, then pull down. Call toll free number before digging. Driver does not carry cash. Some of the trademarks mentioned in this product appear for identification purposes only. Objects in mirror may be closer than they appear. Record additional transactions on back of previous stub. Unix is a registered trademark of AT&;T. Do not fold, tear or mutilate. No transfers issued until the bus comes to a complete stop. Package sold by weight, not volume. Your mileage may vary.
    GUI admin tools have no honor. It is a good day to vi.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts