Chinaunix首页 | 论坛 | 博客
  • 博客访问: 241205
  • 博文数量: 43
  • 博客积分: 1878
  • 博客等级: 上尉
  • 技术积分: 457
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-02 11:08
文章分类

全部博文(43)

文章存档

2011年(3)

2010年(40)

分类: LINUX

2010-09-16 11:02:49

變數設定方式str 沒有設定str 為空字串str 已設定非為空字串
var=${str-expr}var=exprvar=var=$str
var=${str:-expr}var=exprvar=exprvar=$str
var=${str+expr}var=var=exprvar=expr
var=${str:+expr}var=var=var=expr
var=${str=expr}str=expr
var=expr
str 不變
var=
str 不變
var=$str
var=${str:=expr}str=expr
var=expr
str=expr
var=expr
str 不變
var=$str
var=${str?expr}expr 輸出至 stderrvar=var=$str
var=${str:?expr}expr 輸出至 stderrexpr 輸出至 stderrvar=$str

阅读(1165) | 评论(1) | 转发(0) |
0

上一篇:socket

下一篇:shell通配符号

给主人留下些什么吧!~~

chinaunix网友2010-09-16 16:45:37

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com