#!/bin/sh
# check file in current folder
for file in *
do
if [ -f $file ]&&[ -w $file ]&& [ -r $file ]
then
echo "This is a file and Name is: ${file} and it's can be write and read."
elif [ -d $file ]
then
echo "This is a directory and Name is: ${file}"
fi
done
代码来了,给分吧 . 用的原始的SH.