Write a script to broadcast a message to a specified user or a group of users logged on any terminal.

echo -e “Enter the user id where u want to send msg::\c”

read uid

uname=who | grep -c $uid

if [ $uname -gt 0 ]

then

echo $uname

write $uid

else

echo “Broadcast Message to all”

echo “Press [ctrl+d] for exit”

fi

wall

 

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.