如题所述
//是目录不是文件夹
#! /bin/bash
# filename:FileType.sh
read -p "Please input the filename :" filename
fpath=$filename
if [ -d $fpath ];
then
echo "$fpath is a direstory.";
elif [ -e $fpath ];
then
echo "$fpath is a file.";
else
echo "$fpath is NOT a file or direstory.";
fi追问
#! /bin/bash
# filename:FileType.sh
read -p "Please input the filename :" filename
fpath=$filename
if [ -d $fpath ];
then
echo "$fpath is a direstory.";
elif [ -e $fpath ];
then
echo "$fpath is a file.";
else
echo "$fpath is NOT a file or direstory.";
fi追问
你能给解释一下吗?
追答下次解释,现在没空
温馨提示:答案为网友推荐,仅供参考