查找/root/目录下是否存在该文件
vim file.sh
#!/bin/bash
#written by lizheng
#about find file
echo "enter a file"
read a
if test -e /root/$a
then echo "the file is exist!"
else echo "the file is not exist!"
fi
本文共 239 字,大约阅读时间需要 1 分钟。
查找/root/目录下是否存在该文件
vim file.sh
#!/bin/bash
#written by lizheng
#about find file
echo "enter a file"
read a
if test -e /root/$a
then echo "the file is exist!"
else echo "the file is not exist!"
fi
转载于:https://blog.51cto.com/11937277/1881413