You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/variable.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -331,7 +331,7 @@ ${varname:?message}
331
331
332
332
上面语法的含义是,如果变量`varname`存在且不为空,则返回它的值,否则打印出`varname: message`,并中断脚本的执行。如果省略了`message`,则输出默认的信息“parameter null or not set.”。它的目的是防止变量未定义,比如`${count:?"undefined!"}`表示变量`count`未定义时就中断执行,抛出错误,返回给定的报错信息`undefined!`。
0 commit comments