shell中的函數、shell中的數組、告警系統需求分析

shell中的函數

shell中的函數、shell中的數組、告警系統需求分析

示例1打印你的參數

shell中的函數、shell中的數組、告警系統需求分析

shell中的函數、shell中的數組、告警系統需求分析

示例2定義一個加法函數

shell中的函數、shell中的數組、告警系統需求分析

shell中的函數、shell中的數組、告警系統需求分析

示例3顯示IP的函數

shell中的函數、shell中的數組、告警系統需求分析

shell中的函數、shell中的數組、告警系統需求分析

shell中的數組

shell中的函數、shell中的數組、告警系統需求分析

數組就是字符串,一串數字,它形成了一個變量,變量叫做數組
取數組的值。

定義數組

[root@100xuni1 shell]# b=(1 2 3)          ##定義數組
[root@100xuni1 shell]# echo ${b[@]}     ##打印數組也可以把@符號改成*號
1 2 3

查看其中某一個元素的值

[root@100xuni1 shell]# echo ${b[1]}
2
[root@100xuni1 shell]# echo ${b[2]}
3

告警系統需求分析

shell中的函數、shell中的數組、告警系統需求分析

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章