#!/bin/bash dir=`pwd` cd $dir function checkfile(){ if [ -f "yang.txt" ] then echo "file is exstis"
#!/bin/bash
dir=`pwd`
cd $dir
function checkfile(){
if [ -f "yang.txt" ]
then
echo "file is exstis"
else
echo "file not find"
touch yang.txt
fi
}
function checktime(){
files=`find ./ -mtime +3|wc -l`
if [ $files -gt 0 ]
then
echo "I will delete files"
rm -rf $files
else
echo "there is not find some deletefiles"
fi
}
case $1 in
ckf)
checkfile;;
ckt)
checktime;;
*)
echo "Usage:{$0 $1 ckf||ckt }"
esac