name1=/tmp/test/111
name2=/rmp/test/222
name3=/tmp/test/333
do
mv -v $name3 tname
mv -v $name2 $name3
mv -v $name1 $name2
mv -v tname $name1
sleep 3
done
for file in `find /usr/share/doc -name "index.html"`
do
num=$[$num+1]
cp $file /tmp/index/index.$num
done
echo "User search system"
echo "Please input the Username"
read -p "Username:" uname
for i in `cut -d: -f1 /etc/passwd`
do
if [ $i = $uname ]
node=0
echo "User exist"
break
else
node=1
continue
fi
done
then
echo "No this user"
fi
4.写一个脚本,统计出你系统/dev目录下所有设备文件以及管道文件,套接字文件的总数
num1=0
num2=0
num3=0
for i in `find /dev -type b `
do
num1=$[$num1+1]
done
echo $num1
do
num2=$[$num2+1]
done
echo $num2
for k in `find /dev -type s `
do
num3=$[$num3+1]
done
echo $num3