当前位置:网站首页>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
边栏推荐
- Analysis of Alibaba canal principle
- C language file reading and writing
- Try to reprint an article about CSDN reprint
- [concurrent programming] synchronization container, concurrent container, blocking queue, double ended queue and work secret
- Unity Editor Extension - event handling
- Graphics_ Games101/202 learning notes
- 22-05-26 Xi'an interview question (01) preparation
- How to delete CSDN after sending a wrong blog? How to operate quickly
- Collection interface
- too many open files解决方案
猜你喜欢

注解简化配置与启动时加载

单调栈-42. 接雨水

XPath实现XML文档的查询

Facial expression recognition based on pytorch convolution -- graduation project

请求参数的发送和接收
![[RPC] RPC remote procedure call](/img/dc/872204ea47fcff04cdb72e18a2a4ef.jpg)
[RPC] RPC remote procedure call
![[redis] redis persistent RDB vs AOF (source code)](/img/57/b6a86c49cedee31fc00dc5d1372023.jpg)
[redis] redis persistent RDB vs AOF (source code)

Animation_ IK overview

单调栈-503. 下一个更大元素 II

Annotations simplify configuration and loading at startup
随机推荐
Unity editor expansion - draw lines
Life cycle of Servlet
数据库原理期末复习
Graphics_ Games101/202 learning notes
[RPC] RPC remote procedure call
Unity Editor Extension - Outline
Dom4j遍历和更新XML
Collection interface
Unity editor expansion - the framework and context of unity imgui
The method for win10 system to enter the control panel is as follows:
Binary tree sorting (C language, int type)
如何应对数仓资源不足导致的核心任务延迟
Memory search acwing 901 skiing
22-06-28 Xi'an redis (02) persistence mechanism, entry, transaction control, master-slave replication mechanism
MySQL three logs
【Rust笔记】06-包和模块
Arbre DP acwing 285. Un bal sans patron.
[concurrent programming] synchronization container, concurrent container, blocking queue, double ended queue and work secret
22-05-26 Xi'an interview question (01) preparation
TP5 multi condition sorting