#/bin/bash
fpath="/home/chenyu/Desktop/linux/dabian/shell/1.txt"
#fdir="/home/chenyu/Desktop/linux/dabian/shell/back"
fdir="./back"
fexe="./file.sh"
#判断是否为文件
if [ -e $path ];
then
echo "file "${fpath}" exist";
else
echo "file "${fpath}" dose not exist"
fi
#判断是否为目录
if [ -d $fdir ];
then
echo "dictionary "${fdir}" exist";
else
echo "dictionary "${fdir}" dose not exist"
fi
#判断是否为可执行文件
if [ -x $fexe ];
then
echo ${fexe}" can exec"
else
echo ${fexe}" can not exec"
fi