测试文件是否存在
时间:2006-11-03 来源:liuxingyuyuni
#!/bin/bash
echo 'Please input file:';
read file
if [ -e $file ] ;then
clear
echo "-----------File $file exists!--------------"
exit 0
fi echo "-----------File $file not exists!----------"
exit 1
echo 'Please input file:';
read file
if [ -e $file ] ;then
clear
echo "-----------File $file exists!--------------"
exit 0
fi echo "-----------File $file not exists!----------"
exit 1
相关阅读 更多 +