当前位置:网站首页>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
边栏推荐
- [rust note] 10 operator overloading
- 求组合数 AcWing 886. 求组合数 II
- Concurrent programming (VI) ABA problems and solutions under CAS
- Find the combination number acwing 886 Find the combination number II
- Redux - learning notes
- Get the link behind? Parameter value after question mark
- Tree DP acwing 285 A dance without a boss
- Binary tree sorting (C language, int type)
- 【Rust笔记】06-包和模块
- 【Rust笔记】02-所有权
猜你喜欢

22-06-28 Xi'an redis (02) persistence mechanism, entry, transaction control, master-slave replication mechanism
![[concurrent programming] explicit lock and AQS](/img/5f/a80751a68726f53d11133810f454a3.jpg)
[concurrent programming] explicit lock and AQS

XPath实现XML文档的查询

Concurrent programming (III) detailed explanation of synchronized keyword

Mortgage Calculator

TP5 multi condition sorting

Parameters of convolutional neural network

First Servlet

记忆化搜索 AcWing 901. 滑雪

Concurrent programming (VI) ABA problems and solutions under CAS
随机推荐
如何应对数仓资源不足导致的核心任务延迟
[concurrent programming] concurrent tool class of thread
【Rust 笔记】09-特型与泛型
Try to reprint an article about CSDN reprint
Using DLV to analyze the high CPU consumption of golang process
单调栈-42. 接雨水
How does unity fixedupdate call at a fixed frame rate
TP5 order multi condition sort
求组合数 AcWing 886. 求组合数 II
Format - C language project sub file
分配异常的servlet
[concurrent programming] collaboration between threads
MySQL index types B-tree and hash
数位统计DP AcWing 338. 计数问题
Allocation exception Servlet
[concurrent programming] atomic operation CAS
Binary tree sorting (C language, int type)
Unity multi open script
Servlet的生命周期
22-06-28 西安 redis(02) 持久化机制、入门使用、事务控制、主从复制机制