shell
tg5156
这个作者很懒,什么都没留下…
展开
-
shell中$(( ))与$( )还有${ }的区别
原文地址:http://blog.zol.com.cn/2322/article_2321763.html$( )与` `(反引号)在bash shell中,$( )与` `(反引号)都是用来做命令替换(command substitution)用的。$ echo the last sunday is $(date -d "last sunday" +%Y-%m-%d)得到上一转载 2014-02-18 13:46:56 · 14840 阅读 · 0 评论 -
shell中脚本变量和函数变量的作用域
原文地址:http://blog.csdn.net/ltx19860420/article/details/5570902转载 2014-04-23 14:45:44 · 1091 阅读 · 0 评论 -
shell 脚本 set 命令
为 shell 设定参数变量。许多命令的输出是以空格分隔的值,如果要使用其中的某个数据域,使用 set 非常有效。 #!/bin/sh echo the date is $(date) set $(date) echo The month is $2 exit 0 将 date 命令的输出设置为参数表,再通过位置参数 $2 取得月份。因为 date 命令受语言和原创 2014-04-23 15:32:13 · 11566 阅读 · 0 评论 -
shell 脚本参数变量
如果脚本在调用时带有参数,则会额外产生一些变量。即使没有传递任何参数,环境变量 $# 也依然存在,只是值为 0。 $1, $2... 脚本程序的参数 $* 一个全体参数组成的清单,这是一个单独的变量,各个参数之间用环境变量 IFS 中的第一个字符分隔开 $@ $* 的一种变量,它不使用 IFS 环境变量 $* 和 $@ 之间的区别在 X/Open 技术规范里有比较详细的解释原创 2014-04-24 08:06:01 · 972 阅读 · 0 评论 -
shell 脚本 if 语句
if [ expression ]; then commandelse commandfi原创 2014-04-20 22:04:15 · 701 阅读 · 0 评论 -
shell 内建命令 exec
以另一个不同的程序替换当前 shell转载 2014-06-19 14:06:44 · 642 阅读 · 0 评论