1 #!/bin/sh
2 set file = "test03"
3 if [ -f $file ] #如果改为 if [ -f "$file" ]出错??
4 then
5 echo file exists
6 fi
7
8 if [ -d $file ]
9 then
10 echo file is a directory
11 fi
12
13 if [ -s $file ]
14 then
15 echo file is not of zero length
16 fi
17
18 if [ -r $file -a -w $file ]
19 then
20 echo file is readable and writeable
21 fi
阅读(178) | 评论(0) | 转发(0) |