当前位置:网站首页>Methods of using arrays as function parameters in shell
Methods of using arrays as function parameters in shell
2022-07-03 08:53:00 【Xiaoping is extraordinary】
#!/bin/bash
function showArr(){
arr=$1
for i in ${arr[*]}; do
echo $i
done
}
regions=("GZ" "SH" "BJ")
# Double quotation marks cannot be less
showArr "${regions[*]}"
exit 0
Output results :
GZ
SH
BJ
边栏推荐
- 22-05-26 西安 面试题(01)准备
- Deep parsing (picture and text) JVM garbage collector (II)
- createjs easeljs
- [concurrent programming] consistency hash
- Unity interactive water ripple post-treatment
- Convert video to GIF
- 第一个Servlet
- Deeply understand the underlying data structure of MySQL index
- Format - C language project sub file
- Unity Editor Extension - Outline
猜你喜欢
数位统计DP AcWing 338. 计数问题
Deep parsing JVM memory model
Log4j2 vulnerability recurrence and analysis
Campus lost and found platform based on SSM, source code, database script, project import and operation video tutorial, Thesis Writing Tutorial
第一个Servlet
单调栈-42. 接雨水
On the setting of global variable position in C language
[MySQL] MySQL Performance Optimization Practice: introduction of database lock and index search principle
JS non Boolean operation - learning notes
Find the combination number acwing 885 Find the combination number I
随机推荐
too many open files解决方案
Unity editor expansion - draw lines
MySQL three logs
On the difference and connection between find and select in TP5 framework
Gif remove blank frame frame number adjustment
[rust notes] 08 enumeration and mode
求组合数 AcWing 885. 求组合数 I
Unity editor expansion - window, sub window, menu, right-click menu (context menu)
DOM render mount patch responsive system
Message pack in C deserializes array objects
Unity editor expansion - the framework and context of unity imgui
Deeply understand the underlying data structure of MySQL index
Collection interface
PIC16F648A-E/SS PIC16 8位 微控制器,7KB(4Kx14)
Location of package cache downloaded by unity packagemanager
Unity multi open script
Try to reprint an article about CSDN reprint
Sending and receiving of request parameters
Redux - learning notes
樹形DP AcWing 285. 沒有上司的舞會