存档

文章标签 ‘shell编程’

Bash编程七大展开之参数展开(Parameter Expansion)

2009年12月9日 2 条评论

1. ${parameter} 取parameter的值

2. ${parameter:-word} 如果parameter为空,则用word的值做parameter的缺省值

3. ${parameter:=word} 在2的基础上,把word的值赋给parameter

4. ${parameter?=word} 如果parameter为空,word作为错误信息输出。

5. ${parameter+=word} 在parameter不为空的情况下,输出word的值。

6. ${parameter:offset} parameter的从第offset个字符开始的substring
${parameter:offset:length} parameter的从第offset个字符开始的,长度为length的substring
阅读全文…


Warning: mysql_query() [function.mysql-query]: Access denied for user 'root'@'localhost' (using password: NO) in /home/wuzeshengpwmuqzeeas7h4eknug/wwwroot/wp-content/plugins/quickstats/quickstats.php on line 345

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/wuzeshengpwmuqzeeas7h4eknug/wwwroot/wp-content/plugins/quickstats/quickstats.php on line 345

Warning: mysql_query() [function.mysql-query]: Access denied for user 'root'@'localhost' (using password: NO) in /home/wuzeshengpwmuqzeeas7h4eknug/wwwroot/wp-content/plugins/quickstats/quickstats.php on line 346

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/wuzeshengpwmuqzeeas7h4eknug/wwwroot/wp-content/plugins/quickstats/quickstats.php on line 346

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/wuzeshengpwmuqzeeas7h4eknug/wwwroot/wp-content/plugins/quickstats/quickstats.php on line 346