当前位置:网站首页>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
边栏推荐
- [set theory] order relation (total order relation | total order set | total order relation example | quasi order relation | quasi order relation theorem | bifurcation | quasi linear order relation | q
- 高斯消元 AcWing 883. 高斯消元解线性方程组
- How does unity fixedupdate call at a fixed frame rate
- [concurrent programming] consistency hash
- Get the link behind? Parameter value after question mark
- 分配异常的servlet
- Find the combination number acwing 886 Find the combination number II
- 22-05-26 西安 面试题(01)准备
- 我们有个共同的名字,XX工
- Escape from heaven and forget what he suffered. In ancient times, it was called the punishment of escape from heaven. Article collection
猜你喜欢
Message queue for interprocess communication
Binary tree sorting (C language, char type)
Mortgage Calculator
Binary to decimal, decimal to binary
第一个Servlet
JS non Boolean operation - learning notes
Slice and index of array with data type
Graphics_ Learnopongl learning notes
Log4j2 vulnerability recurrence and analysis
SQL statement error of common bug caused by Excel cell content that is not paid attention to for a long time
随机推荐
Query XML documents with XPath
记忆化搜索 AcWing 901. 滑雪
Tree DP acwing 285 A dance without a boss
Phpstudy 80 port occupied W10 system
【Rust 笔记】11-实用特型
Use of sort command in shell
Unity Editor Extension - event handling
【Rust 笔记】08-枚举与模式
Find the combination number acwing 885 Find the combination number I
Complex character + number pyramid
树形DP AcWing 285. 没有上司的舞会
Markdown learning
Gaussian elimination acwing 883 Gauss elimination for solving linear equations
[rust notes] 02 ownership
Downward compatibility and upward compatibility
Unity notes 1
Unity Editor Extension - Outline
too many open files解决方案
Talking about: is the HashSet set ordered or disordered /hashset set unique, why can we store elements with the same content
Concurrent programming (III) detailed explanation of synchronized keyword