Llinux Gvim Shell Array

Source: Internet
Author: User

#数组: Bash supports only one-dimensional arrays, starting with subscript 0.
#定义数组: Array_name= (value0 value1 value2), as follows

1 array_name=(2value03value14value2  5 )

#还可以单独定义数组的各个分量, a continuous subscript may not be used, and the subscript range is not limited, as follows

1 array_name[0]="value0"2 array_name[1]="  value1"3 array_name[3]="value3"

#读取数组: Specify get ${array_name[index]}, get all ${array_name[* or @]} as follows

1 valuen=${array_name[0]}2echo""3  echo""

#获取数组的长度, same as get string length

1 Echo "  "    #获取数组的长度 #2echo""    # Gets the length of the array #3echo""    #获取索引为1的内容的长度 #



Llinux Gvim Shell Array

Related Article

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.