当前位置:网站首页>Shell jump loop shift parameter left use of function
Shell jump loop shift parameter left use of function
2022-06-25 18:51:00 【51CTO】
- shift The command is used to move parameters ( Move left ), It is usually used to traverse each parameter in turn without knowing the number of incoming parameters
And then carry out corresponding treatment ( Common in Linux Start scripts for various programs in ) - When scanning the parameters of the processing script program , Often used shift command , If your script needs to 10 Or 10 More than one
Parameters , You need to use shift Command to access the second 10 And the parameters after that - Use return Command to exit the function and return a specific exit code . notes : The determination of the status code must be run at the end of the function return Return value ; The value range of the status code (0~255)
notes : The return value of the function here is different from that of other programming languages . If there is in the function return sentence , Then through the “ Variable =?” In the form of .
4. use function When defining a function, add a space between the left brace and the preceding function name , No mistake will be reported . If function name is used () There is no need to add a space in the form of
- Global variables , By default , The variables you define in the script are global variables , The variables you define outside the function can also be used inside the function
边栏推荐
- Detailed explanation of route add command
- [in depth understanding of tcapulusdb technology] form creation and approval of document acceptance
- 网络安全检测与防范 测试题(四)
- R语言使用DALEX包的model_profile函数基于条件依赖CDP方法解释多个分类模型中某个连续特征和目标值y的关系(Conditional Dependence Plots)
- Addition, deletion, modification and query of mysql~ tables (detailed and easy to understand)
- Basic operation details of binary search tree (BST) (complete code, including test cases)
- 云上弹性高性能计算,支持生命科学产业高速发展、降本增效
- [in depth understanding of tcapulusdb technology] tcapulusdb operation and maintenance
- 如何快速关闭8080端口
- Redis6
猜你喜欢
[in depth understanding of tcapulusdb technology] tcapulusdb operation and maintenance
Analysis on development scale and development trend of China's night economy industry in 2021 [figure]
两轮市场红海,利尔达芯智行如何乘风破浪?
快手616战报首发,次抛精华引新浪潮,快品牌跃入热榜top3
削足适履 - 谈谈赛道上的坡道改造
【C语言练习——打印上三角及其变形(带空格版)】
SVN介绍及使用总结
158_ Model_ Power Bi uses DAX + SVG to open up almost all possibilities for making business charts
[in depth understanding of tcapulusdb technology] form creation and approval of document acceptance
[C language practice - print the upper triangle and its deformation (with blank version)]
随机推荐
【ELT.ZIP】OpenHarmony啃论文俱乐部—见证文件压缩系统EROFS
Batch uploading of local jar packages to nexus private server
JS get data
Overview and trend analysis of China's foreign direct investment industry in 2020 [figure]
RMAN backup database_ catalogue
JVM|运行时数据区(堆空间)
R语言使用DALEX包的model_profile函数基于条件依赖CDP方法解释多个分类模型中某个连续特征和目标值y的关系(Conditional Dependence Plots)
Analysis of China's medical device industry development environment (PEST) in 2021: the awareness of medical care is enhanced, and the demand for medical device products is also rising [figure]
RMAN backup database_ Restart RMAN backup
solidity 合约地址转钱包、钱包地址转合约
Analysis on China's aluminum foil output, trade and enterprise leading operation in 2021: dongyangguang aluminum foil output is stable [figure]
焕新出发,利尔智达天下
Differences and relations between sequential table and array (easy to confuse), linear table and linked list
Training of long and difficult sentences in postgraduate entrance examination day88
广州华锐互动VR全景为各行各业带来发展
User management and permissions
158_ Model_ Power Bi uses DAX + SVG to open up almost all possibilities for making business charts
Problems encountered during the use of pychar
[deeply understand tcapulusdb technology] tmonitor background one click installation
正则表达式总结