Linux System-shell programming-several shell scriptsone kill the userkilluser.sh#!/bin/sh
# The script to kill login user
User_name= "$"
/bin/ps aux | /bin/grep $user _name | /bin/awk ' {print $} ' >/tmp/temp.pid
Kill_id= ' Cat/tmp/temp.pid '
For PID in kill_id
do
/bin/kill-9 $PID 2>/dev/null
Done
two adding users in bulkuseradd.sh#/bin/sh
echo "Input name"
Read name
echo "Input num"
Read Num
N=1
While [$n-le $num]
do
/usr/bin/useradd $name $n
n= ' expr $n + 1 '
Done
echo "Please input the passwd"
Read passwd
M=1
While [$m-le $num]
do
echo $passwd | /USR/BIN/PASSWD--stdin $name $m
m= ' expr $m + 1 '
Done
Setuid of the three-check systemsetuid.sh#!/bin/sh
Mkdir/backup
/usr/bin/find/-perm-4000-o -2000 >/tmp/setuid.check 2>/dev/null
For file in '/bin/cat/tmp/setuid.list >/dev/null '
do
/bin/grep $file/backup/setuid.list >/dev/null
If ["#?! =" 0 "]
Then
echo "$file is not in list"
Fi
Done
/bin/rm/tmp/setuid.check
Attached: MY_QQ 872785786 and Linux system basis corresponding network disk data link: Http://pan.baidu.com/s/1ydewA Password: Kaek
Welcome to Exchange Learning-Android embedded development, if you want to get more information for free, please contact me-sharing spirit, provide 1000g+ technical information
iOS, Android, embedded, and various programming languages
Linux system-shell Programming-several shell scripts