${parameter−default}, ${parameter:−default}

605阅读 0评论2011-04-25 meteorm
分类:LINUX

${parameter−default}, ${parameter:−default}
If parameter not set, use default.
echo ${username−`whoami`}
# Echoes the result of `whoami`, if variable $username is still unset.
 
${parameter−default} and ${parameter:−default} are almost
equivalent. The extra : makes a difference only when parameter has been declared,
but is null.
上一篇:rd windows删除文件夹命令
下一篇:error PRJ0019: A tool returned an error code from