- Learning Linux Shell Scripting
- Ganesh Naik
- 94字
- 2021-06-25 22:02:57
Working with arrays
An array is a list of variables. For example, we can create an array called FRUIT, which will contain the names of many fruits. The array does not have a limit on how many variables it may contain. It can contain any type of data. The first element in an array will have the index value of 0:
[student@localhost ~]$ FRUITS=(Mango Banana Apple)
[student@localhost ~]$ echo ${FRUITS[*]}
Mango Banana Apple
[student@localhost ~]$ echo $FRUITS[*]
Mango[*]
[student@localhost ~]$ echo ${FRUITS[2]}
Apple
[student@localhost ~]$ FRUITS[3]=Orange
[student@localhost ~]$ echo ${FRUITS[*]}
Mango Banana Apple Orange
推薦閱讀
- 大數(shù)據(jù)導(dǎo)論:思維、技術(shù)與應(yīng)用
- 大數(shù)據(jù)管理系統(tǒng)
- 大數(shù)據(jù)項(xiàng)目管理:從規(guī)劃到實(shí)現(xiàn)
- OpenStack for Architects
- Dreamweaver CS3網(wǎng)頁制作融會貫通
- 走入IBM小型機(jī)世界
- ServiceNow Cookbook
- 計(jì)算機(jī)網(wǎng)絡(luò)應(yīng)用基礎(chǔ)
- 信息物理系統(tǒng)(CPS)測試與評價(jià)技術(shù)
- 基于32位ColdFire構(gòu)建嵌入式系統(tǒng)
- Kubernetes for Serverless Applications
- 智能生產(chǎn)線的重構(gòu)方法
- 單片機(jī)技術(shù)項(xiàng)目化原理與實(shí)訓(xùn)
- 網(wǎng)絡(luò)服務(wù)器搭建與管理
- Machine Learning with Spark(Second Edition)