The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
logged out users roshni Post Here to Contact Site Administrators and Moderators 1 07-06-2007 03:02 AM
HP-UX users get logged off while idle. Laoinjo UNIX for Advanced & Expert Users 5 06-04-2007 11:28 AM
how many users logged trichyselva Shell Programming and Scripting 4 05-06-2006 02:17 AM
Users logged in through which NIC cburtgo IP Networking 5 04-28-2006 06:59 PM
All tcp/ip users are logged out Docboyeee IP Networking 2 03-13-2003 01:07 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-30-2007
shanshine shanshine is offline
Registered User
  
 

Join Date: May 2007
Posts: 16
hi

Hi,

can u say to display the number of users that logged before me.

thanks

Last edited by shanshine; 05-30-2007 at 05:01 AM..
  #2 (permalink)  
Old 05-30-2007
suparnbector suparnbector is offline
Registered User
  
 

Join Date: May 2007
Posts: 13
Try this..should work

who | awk '{print $1}'|uniq
  #3 (permalink)  
Old 05-30-2007
ennstate ennstate is offline
Registered User
  
 

Join Date: Mar 2007
Location: Chennai
Posts: 222
Hope this helps

Code:
 who | awk ' { print $1 }' | sort -ud
Thanks.
Nagarajan G
  #4 (permalink)  
Old 05-30-2007
shanshine shanshine is offline
Registered User
  
 

Join Date: May 2007
Posts: 16
Quote:
Originally Posted by ennstate
Hope this helps

Code:
 who | awk ' { print $1 }' | sort -ud
Thanks.
Nagarajan G
but it shows
+ who
+ awk '{ print $1 }'
+ sort -ud
these lines also.
  #5 (permalink)  
Old 05-30-2007
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,533
Code:
who | awk '{usr[$1]}END{for(i in usr)print i}'
  #6 (permalink)  
Old 05-30-2007
aigles's Avatar
aigles aigles is offline Forum Advisor  
Registered User
  
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,423
Quote:
Originally Posted by shanshine
but it shows
+ who
+ awk '{ print $1 }'
+ sort -ud
these lines also.
You have the -x option on (prints executed commands and their arguments).
To disable this option :
Code:
set +x
An example :
Code:
$ set -x
$ date
+ date
Wed May 30 09:40:54 DFT 2007
$ set +x
$ date
Wed May 30 09:41:01 DFT 2007
$
Jean-Pierre
  #7 (permalink)  
Old 05-30-2007
shanshine shanshine is offline
Registered User
  
 

Join Date: May 2007
Posts: 16
Quote:
Originally Posted by aigles
You have the -x option on (prints executed commands and their arguments).
To disable this option :
Code:
set +x
An example :
Code:
$ set -x
$ date
+ date
Wed May 30 09:40:54 DFT 2007
$ set +x
$ date
Wed May 30 09:41:01 DFT 2007
$
Jean-Pierre
"i want no. of users logged in before me"
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:44 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0