当前位置:网站首页>Shell Scripting
Shell Scripting
2022-06-23 19:33:00 【Jokic_ Rn】
bash At the beginning of the instruction #!/bin/bash It means using the path /bin/ Under the bash perform shell command , Any one that appears later #! Are only considered as comments
Positional arguments
shell The script uses $*,[email protected],$#,$n To receive input parameters [email protected] and $* All the input parameters ,[email protected] For treating these parameters separately , You can loop through each input parameter ,$* The input parameters are treated as a whole $# Indicates the number of input parameters $n Indicates the number of input parameters , such as $4 It means the first one 4 Input parameters ,${11} It means the first one 11 Input parameters .
Example :
#!/bin/bash
echo Total params numbers : $#
echo Second params is : $2
echo Params is : $*
for i in [email protected]
do
echo $i
done
result
(base) [email protected]:~/.trash$ bash trash1.sh 123 love air hello_world okay
Total params numbers : 5
Second params is : love
Params is : 123 love air hello_world okay
123
love
air
hello_world
okay
边栏推荐
- Programmable, protocol independent software switch (read the paper)
- 【NOI2014】15.起床困难综合症【二进制】
- Obtain equipment information
- How to make a list sort according to the order of another list
- 火线沙龙第26期-多云安全专场
- 盘点四种WiFi加密标准:WEP、WPA、WPA2、WPA3
- Helix QAC更新至2022.1版本,将持续提供高标准合规覆盖率
- sed replace \tPrintf to \t//Printf
- Netcf summary
- Naacl 2022 finds | byte proposes MTG: multilingual text generation data set
猜你喜欢

基于 ShardingSphere 的得物数据库中间件平台“彩虹桥”演进之路

硬件开发笔记(六): 硬件开发基本流程,制作一个USB转RS232的模块(五):创建USB封装库并关联原理图元器件

How can enterprises do business monitoring well?

Live broadcast review | detailed explanation of koordinator architecture of cloud native hybrid system (complete ppt attached)

Robust extraction of specific signals with time structure (Part 2)

20set introduction and API
![Develop small programs and official account from zero [phase II]](/img/09/8be73fdadc7b1f0fa1ee4db8267094.jpg)
Develop small programs and official account from zero [phase II]

Noah fortune passed the hearing: with an annual revenue of 4.3 billion yuan, Wang Jingbo has 49% voting rights, and Sequoia is a shareholder

墨天轮访谈 | IvorySQL王志斌—IvorySQL,一个基于PostgreSQL的兼容Oracle的开源数据库

Take out Jianghu will change, and meituan "big brother" is hard to be
随机推荐
考PMP有用吗?
Database migration tool flyway vs liquibase (I)
盘点四种WiFi加密标准:WEP、WPA、WPA2、WPA3
JDBC 在性能測試中的應用
Helix QAC is updated to 2022.1 and will continue to provide high standard compliance coverage
Cloud security daily 220623: the red hat database management system has found an arbitrary code execution vulnerability and needs to be upgraded as soon as possible
Graffiti intelligence passed the hearing: Tencent is an important shareholder planning to return to Hong Kong for listing
Take out Jianghu will change, and meituan "big brother" is hard to be
[comparative learning] koa JS, gin and asp Net core - Middleware
NLP 论文领读|改善意图识别的语义表示:有监督预训练中的各向同性正则化方法
[one by one series] identityserver4 (II) using client credentials to protect API resources
CV fully connected neural network
准备好迁移上云了?请收下这份迁移步骤清单
Function definition and function parameters
sed replace \tPrintf to \t//Printf
Robust extraction of specific signals with time structure (Part 1)
Chaos engineering, learn about it
[one by one series] identityserver4 (IV) authorization code process
20省市公布元宇宙路线图
1、 Summary and introduction