Tuesday 21 April 2015

Write a shell program to accept a username and displays an appropriate message if the user is logged into the system or not.

This shell program checks and returns the appropriate message about the logged in users in system.


list=`users`
for var in $list
do
if [ $var == $1 ];
then
echo "The given user is logged in"
exit 1
fi
done



No comments:
Write comments

Featured post

List of Universities in Karnataka offering M.Sc Computer Science

The post-graduate programme in Computer Science (M.Sc Computer Science) contains two academic years duration and having a four semesters....

Popular Posts

Copyright @ 2011-2022