2写一个脚本,根据传入的参数判断此参数为普通文件或目录或其他。
file=$1
if [ -f $file ]
then
echo "普通"
elif [ -d $file ]
then
echo "目录"
else
echo "其他"
fi
2写一个脚本,根据传入的参数判断此参数为普通文件或目录或其他。
file=$1
if [ -f $file ]
then
echo "普通"
elif [ -d $file ]
then
echo "目录"
else
echo "其他"
fi