摘要: 假定目录text下有如下文件 目录:dir_1、dir_2、dir_3 文件:text_1、text_2遍历目录下所有的文件是目录还是文件if -- if类型:#!bin/shfor file in ./*do if test -f $file then echo $file 是文件 fi if test -d $file then echo $file 是目录 fidoneif --else 类型:#!bin/shfor file in ./*do if test -f $file then e... 阅读全文
posted @ 2012-12-19 19:02 jihite 阅读(213333) 评论(4) 推荐(1)
摘要: 定义变量 name=value 释义:name是变量,value是变量值 注意:1.变量名智能有数字、字母、下划线组成,并且首字符不可是数字。 eg: a12=123kdlkd 2.变量值(value)中如果有空格,应该加上双引号或单引号。eg: a="hello world" 3.等号(=)左右没有空格,切记。eg:a = 'akdf'错误使用变量: 变量名前加上$。eg: 释义:echo为打印函数 echo a 就是单纯输出a;而echo $a ,因为前面有$,提... 阅读全文
posted @ 2012-12-19 17:06 jihite 阅读(3115) 评论(0) 推荐(0)