shell编程实例二判断文件类型

820阅读 0评论2014-12-09 644924073
分类:LINUX

#!/bin/sh
if [ $# -ne 1 ]
then echo "agrc is error"
 exit
fi
if [ -f $1 ]
then echo "this is file"
fi

if [ -d $1 ]
then echo "this is dirctory"
fi
上一篇:shell编程实例三实现简单运算符
下一篇:shell特殊字符详解