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