1. 首页
  2. 数据库
  3. 其它
  4. Shell 函数参数

Shell 函数参数

上传者: 2021-01-17 00:19:45上传 PDF文件 32.09KB 热度 16次
在shell中,调用函数时可以向其传递参数。在函数体内部,通过 $n 的形式来获取参数的值,例如,$1表示第一个参数,$2表示第二个参数... 带参数的函数示例: #!/bin/bash funWithParam(){ echo The value of the first parameter is $1 ! echo The value of the second parameter is $2 ! echo The value of the tenth parameter is $10 ! echo The value of the tenth paramete
下载地址
用户评论