Home Linux Write a script which will display whether your friend has logged in or not. If yes, send him some message.

Write a script which will display whether your friend has logged in or not. If yes, send him some message.

44 second read
0
0
62

Write a script which will display whether your friend has logged in or not. If yes, send him some message.


echo "Enter user name:"

read name

who | grep $name > /dev/null

if [ $? -eq 0 ]

then

echo "User is logged in..."

echo "Please enter a message to send:"

read msg

write $msg

else

echo "User is not logged in.."

fi

Load More Related Articles
Load More By coder coder
Load More In Linux

Leave a Reply

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

Check Also

Prime Or Not Prime vb.net Program.

Prime Or Not Prime . …