This is the fourth day of my participation in the wenwen Challenge

#! /bin/bash
while true
do
echo "input path:"
read path
if [ $path = "q" ]
then break
elif [ -d $path ]
then
 
for file in `ls $path`
do
file=$path/$file
if [ -d $file ]
then echo "${file}_d"
elif [ -b $file ]
then echo "${file}_b"
elif [ -L $file ]
then echo "${file}_ |"
elif [ -f $file ]
then echo "${file}_ -" 
else echo "${file}_c"
fi

done

else echo "illegal input"
fi
done

Copy the code

#! /bin/bash
while true
do
echo "Use one of the following options P:To display current directory S:To display the name of running file D:To display Today's date and present time 2017-04-26 05:45:12) L:To see the list of files in your present working directory W:To see who is logged in I:To see the  ip address of this local machine Q:To quit this program Enter your option and hit:"
read in
case $in in
P|p) pwd ;;
S|s) echo $0 ;;
D|d) date "+%Y-%m-%d %H:%M:%S";;
L|l) ls ;;
W|w) w ;;
I|i) ip add ;;
Q|q) break ;; 
*) echo "!!!!!!!! illegal input!!!!!!!!"
esac
done


Copy the code

#! /bin/bash
while true
do
echo "input path:"
read path
if [ $path = "q" ]
then break
elif [ -d $path ]
then
 
for file in `ls $path`
do
file=$path/$file
if [ -d $file ]
then echo "${file}_d"
elif [ -b $file ]
then echo "${file}_b"
elif [ -L $file ]
then echo "${file}_ |"
elif [ -f $file ]
then echo "${file}_ -" 
else echo "${file}_c"
fi

done

else echo "illegal input"
fi
done

Copy the code

#! /bin/bash
function func(){
a=The $1
echo -e 
until [ $a -eq 0 ]
do
   echo -n "$a "
   let a=$a- 1done
}
while true
do
echo  Please, input a number:
read b
until [ $b -le 0 ]
do
   func $b
   let b=$b- 1done
echo -e
done

Copy the code
30 8 * * * /home/zkpk/shell/startftp.sh
30 23 * * * systemctl stop vsftpd
50 23 * * * /home/zkpk/shell/tarfile.sh
30 8-23/1 * * * /home/zkpk/shell/pingbaidu.sh

#! /bin/bash
# /home/zkpk/shell/startftp.sh
# open VSFTPD
systemctl start vsftpd
if [ $? -eq 1 ]; then
echo "start ftp error" | mail -s "error" root
else 
ps -ef | grep vsftpd | head -n1 >> /var/ftp/"`date +%Y-%m-%d`".log
fi

#! /bin/bash
# /home/zkpk/shell/pingbaidu.sh
# ping baidu
ping -c 4 www.baidu.com >> /var/ftp/"`date +%Y-%m-%d`".log

#! /bin/bash
# /home/zkpk/shell/tarfile.sh
Zip file
sleep 30s 
tar -czvf "`date +%Y-%m-%d`".tar.gz /var/ftp
chmod 400 "`date +%Y-%m-%d`".tar.gz
mv "`date +%Y-%m-%d`".tar.gz  /root
rm -rf /var/ftp/*

Copy the code