Linux Shell Programming (2): For while

Source: Internet
Author: User

 for((i =0; I <5; i++)) Do        Echo "Current number is $i" DoneSERVICES="8000-3306" forXinch$SERVICES Do        Echo$x Done forXincha b c Do        Echo$x Done forIinch$* #$* is a string:"parameter 1 parameter 2 ..."form to save all parameters Do        Echo "parameter is $i" Done forIinch*.SH DoEcho$i Done forIinch$(ls*.SH) Do        Echo$i DoneArray=(A1 A2 A3) #array=([0]=A1 [1]=A2 [2]=A3) #array [0]=A1 array[1]=A2 array[2]=A3Echo "The length of array is ${#array [@]}" forIteminch${array[@]} Do        Echo "item in array:"$item Done forIinch/users/scg/pycharmprojects/xiaoliang/main/*. Pydo Echo $idone

i=5and0  ]do        echo  $i        if2  ]        thenbreak fi        i=$[i-1          ] Done

Linux Shell Programming (2): For while

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.