Write a linux shell program to perform count number of user’s login and print first login user information.

Write a shell script to count number of user’s login and print first login user information.

Code:

clear 
echo -------------------------- 
echo '\tLogin User' 
echo -------------------------- 
echo The number of  users loggin in are 
who | wc -l 
echo First login user  
who | head -1

Output:

-------------------------- 
Login User 
-------------------------- 
The number of users loggin in are 
First login user 
elcot    tty7         2013-12-21 11:02 (:0) 

No comments

Powered by Blogger.