我遇到过已经存在的shell脚本。想要了解$ {1 ,,}在这里的含义:
if [[ ${2} -eq 0 ]]; then
delNam${1,,}_delete_$date
shell脚本新手。
答案 0 :(得分:1)
${1,,}
将convert第一个positional parameter改为小写。换句话说,如果脚本像./script.sh FooBar 0
一样运行而$date
是2016
,则第二行将扩展为delNamfoobar_delete_2016
,然后将作为命令运行。< / p>
答案 1 :(得分:0)
$ {2}用于输入第二个参数&amp; delNam $ {1 ,,} 删除 $ date,用于输入当前日期的第一个参数。