, 03-01-2011 at 05:19 PM (14561 Views)
This program takes a user name from the user and checks if the user is authentic.If so,it checks if he has logged on to the system.
If the user is logged in,the show time of login.
echo "Enter user name"
grep $a /etc/passwd > aa.txt
if [ -s aa.txt ]
echo "Authentic User"
grep $a bb >cc.txt
if [ -s cc.txt ]
echo " The user is logged in"
echo "Time of login :"
who | cut -d "-" -f3 | cut -d " " -f2
echo "The user is not logged in"
Disclaimer: Users of techforum4u.com are responsible for ensuring that any material they post (article, blog posts, images or other mulitimedia content) does not violate or infringe upon the copyright, patent, trademark, or any personal or proprietary rights of any third party, and is posted with the permission of the owner of such rights.Anyone who violates these rules may have their access privileges removed without warning.