Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
591 B
1
Indexable
Never
#!/bin/bash

read -p "please enter your address : " address
count=0


if [ -e $address ]
then

for f in `ls $address | grep .tmp$`
do
echo "---> $f <---"
((count++))
done

if [ $count = 0 ]
then
echo "-----------------------------------------"
echo " ----> no file tmp in your directory <---"
else

read -p "Are you sure about delete this files? (y/n)" bool

if [ bool = "y" ]
then

for f in `ls $address | grep .tmp$`
do
rm $address/$f
done

else
echo "-----------------------"
echo "OK see you soon byee (:"
fi
fi
else
echo "-----------------------"
echo "your file does not correct :("
fi
Leave a Comment