当前位置:网站首页>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
边栏推荐
- LinkedList set
- PHP function date (), y-m-d h:i:s in English case
- 状态压缩DP AcWing 91. 最短Hamilton路径
- Deep parsing JVM memory model
- [concurrent programming] consistency hash
- Tree DP acwing 285 A dance without a boss
- 求组合数 AcWing 886. 求组合数 II
- Graphics_ Games101/202 learning notes
- Apache startup failed phpstudy Apache startup failed
- Talking about: is the HashSet set ordered or disordered /hashset set unique, why can we store elements with the same content
猜你喜欢

Query XML documents with XPath

SQL statement error of common bug caused by Excel cell content that is not paid attention to for a long time

第一个Servlet

求组合数 AcWing 886. 求组合数 II

Parameters of convolutional neural network

Graphics_ Games101/202 learning notes

Campus lost and found platform based on SSM, source code, database script, project import and operation video tutorial, Thesis Writing Tutorial
![[concurrent programming] Table hopping and blocking queue](/img/b7/023991a00956e469af855e7a81e126.jpg)
[concurrent programming] Table hopping and blocking queue

Gif remove blank frame frame number adjustment

Concurrent programming (III) detailed explanation of synchronized keyword
随机推荐
【Rust 笔记】09-特型与泛型
Try to reprint an article about CSDN reprint
Methods of checking ports according to processes and checking processes according to ports
Drawing maze EasyX library with recursive backtracking method
[rust notes] 05 error handling
Convert video to GIF
Binary tree traversal (first order traversal. Output results according to first order, middle order, and last order)
Really explain the five data structures of redis
Concurrent programming (III) detailed explanation of synchronized keyword
Apache startup failed phpstudy Apache startup failed
Graphics_ Learnopongl learning notes
How to use Jupiter notebook
Downward compatibility and upward compatibility
Arbre DP acwing 285. Un bal sans patron.
【Rust 笔记】10-操作符重载
How to delete CSDN after sending a wrong blog? How to operate quickly
cres
Development experience and experience
Unity interactive water ripple post-treatment
树形DP AcWing 285. 没有上司的舞会