Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1361845
  • 博文数量: 343
  • 博客积分: 13098
  • 博客等级: 上将
  • 技术积分: 2862
  • 用 户 组: 普通用户
  • 注册时间: 2005-07-06 00:35
文章存档

2012年(131)

2011年(31)

2010年(53)

2009年(23)

2008年(62)

2007年(2)

2006年(36)

2005年(5)

分类:

2010-09-10 19:38:13

Q: I am looking at a script written for the runscript shell. I have a line as
follows:

if [[ ${RC_INTERACTIVE:-yes} == "yes" ]] ; then

I would like to know what the :- (colon minus) operator that follows the
variable name does.

A: Like in a normal (POSIX like) shell - "info bash" says:

${PARAMETER:-WORD}'
If PARAMETER is unset or null, the expansion of WORD is
substituted. Otherwise, the value of PARAMETER is substituted.
阅读(929) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~