Logo 
Search:

Unix / Linux / Ubuntu Forum

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds

Shell script

  Asked By: Amit    Date: Jun 19    Category: Unix / Linux / Ubuntu    Views: 1840
  

(1) Write a shell script who currently loggedin to the server.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Kirtiranjan Sahoo     Answered On: Aug 08

#!/bin/bash

log=`who | sort -n | cut -d" " -f1 | head -1`
echo "The $log user currently logged in to your server"

 
Didn't find what you were looking for? Find more on Shell script Or get search suggestion and latest updates.




Tagged: