"Linux" shell string segmentation, array access, conditional judgment

Source: Internet
Author: User

Resources:

Shell String Split recycle: http://www.shangxueba.com/jingyan/1633455.html

Description of the If else and greater than, less than, equal to logical expressions in the Linux shell: http://www.jb51.net/article/34332.htm

Shell array: Definition of shell array, array length: http://c.biancheng.net/cpp/view/7002.html

Shell Array Length: http://blog.csdn.net/shaobingj126/article/details/7395570

Shell Array Length: http://blog.csdn.net/lhf_tiger/article/details/18882223

Example code:

Api_proxy_ip_list= (' Echo ${api_proxy_ip} | tr";" "\ n"`)if[${#API_Proxy_IP_List [@]}-ne1 ]; Then Echo"==========api_proxy_ip have more Than one Item, do nothing...=========="ElseEcho"==========api_proxy_ip has one Item, Update the/etc/hosts...=========="mungehosts-A"${api_proxy_ip} ${api_domain}"fi

"Linux" shell string segmentation, array access, conditional judgment

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.