- 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ù)展現(xiàn)的藝術(shù)
- 機(jī)器學(xué)習(xí)實(shí)戰(zhàn):基于Sophon平臺(tái)的機(jī)器學(xué)習(xí)理論與實(shí)踐
- 大數(shù)據(jù)技術(shù)與應(yīng)用基礎(chǔ)
- Div+CSS 3.0網(wǎng)頁布局案例精粹
- 輕松學(xué)Java Web開發(fā)
- R Machine Learning By Example
- 水晶石精粹:3ds max & ZBrush三維數(shù)字靜幀藝術(shù)
- Moodle Course Design Best Practices
- 中國戰(zhàn)略性新興產(chǎn)業(yè)研究與發(fā)展·增材制造
- 網(wǎng)絡(luò)服務(wù)器搭建與管理
- 單片機(jī)技術(shù)項(xiàng)目化原理與實(shí)訓(xùn)
- PowerMill 2020五軸數(shù)控加工編程應(yīng)用實(shí)例
- 步步驚“芯”
- 機(jī)器人制作入門(第4版)
- Practical AWS Networking