Free Web Hosting | Web Hosting | Free Web Space | Web Hosting

Home

#*************************************************************************

# This script is used to kill all users except the user in the console

# It is checked on DRS600 Sparc Unix v 4.0

# Author G. Pradeep. email: pradeep@ipath.net.in. site: www.ipath.net.in/pradeep/

#*********************************************************************************

echo "Please wait I am working...........!"

who -u|grep "^$1" > temp

c=`cat temp|wc -l`

i='1'

ans=""

while [ $i -le $c ]

do

term_id=`cat temp|head -$i|tail -1|tr -s " "" "|cut -d " " -f7`

term_name=`cat temp|head -$i|tail -1|tr -s " "" "|cut -d " " -f2`

echo "Kill terminal $term_name (Y/N) ?\c"

read ans

# if [ test -n $ans ]

# then

# echo "null string"

# else

# echo "not null string"

# exit

# fi

if [ $ans = Y -o $ans = y ]

then

kill -9 $term_id

else

echo "Not Killed"

fi

i=`expr $i + 1`

done

rm temp

Home