shell main函数
时间: 2023-10-12 15:08:14 浏览: 83
在Shell脚本中,可以定义一个名为main的函数作为脚本的唯一入口。可以使用case语句来调用其他函数,包括main函数。在函数内部,可以使用变量来存储数据,函数里的变量默认是全局变量,其他函数可以使用。因此,需要注意变量名不要重复。通过函数的嵌套调用,可以实现复杂的脚本功能。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [详解shell 函数定义与调用](https://download.csdn.net/download/weixin_38730201/14888674)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [shell脚本之 函数——【初学者必看】](https://blog.csdn.net/weixin_59663288/article/details/124478809)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [[轻松学会shell编程]-2、函数](https://blog.csdn.net/m0_48638643/article/details/124629635)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文