#!/bin/bash
myfunc()
{
for x in $(ls)
do
if [ -f "$x" ];then
echo "$x is file";
rm -rf "$x";
elif [ -L "$x" ];then
echo "this is a link";
else
echo "$x is directory";
cd "$x";
myfunc;
cd ..
fi
done
}
cd /home/www/mall/templates
myfunc
myfunc()
{
for x in $(ls)
do
if [ -f "$x" ];then
echo "$x is file";
rm -rf "$x";
elif [ -L "$x" ];then
echo "this is a link";
else
echo "$x is directory";
cd "$x";
myfunc;
cd ..
fi
done
}
cd /home/www/mall/templates
myfunc