shell脚本查看参数类型
时间: 2023-08-27 15:21:02 浏览: 232
shell脚本命令行参数简介
要查看shell脚本中的参数类型,可以使用特殊变量$@来表示所有的位置参数。在脚本中,可以使用for循环来遍历$@,然后使用条件判断语句来确定参数的类型。以下是一个示例脚本:
```shell
#!/bin/bash
for arg in "$@"
do
if [[ $arg =~ ^<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [Shell脚本接收位置参数,变量的定义、分类和查看](https://blog.csdn.net/weixin_64334766/article/details/128650172)[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^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [shell脚本参数](https://blog.csdn.net/xiaowoniuwzx/article/details/105447216)[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^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文