#!/bin/sh
if [ $# -ne 1 ]
then echo "agrc is error"
exit
fi
then echo "agrc is error"
exit
fi
if [ -f $1 ]
then echo "this is file"
fi
then echo "this is file"
fi
if [ -d $1 ]
then echo "this is dirctory"
fi
本文介绍了一段使用Shell脚本实现的文件属性判断代码,包括判断文件是否存在、是否为目录的功能。

被折叠的 条评论
为什么被折叠?