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
Need a regular expression tony3101 Shell Programming and Scripting 4 06-05-2008 03:13 AM
regular expression and awk nickg UNIX for Dummies Questions & Answers 2 08-16-2007 05:23 PM
regular expression...help!! andy2000 UNIX for Dummies Questions & Answers 6 07-18-2007 05:10 PM
help in regular expression Rakesh Ranjan High Level Programming 5 10-25-2006 01:00 PM
Regular Expression + Aritmetical Expression Z0mby Shell Programming and Scripting 2 05-21-2002 10:59 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-21-2004
jaber87 jaber87 is offline
Registered User
  
 

Join Date: Apr 2004
Posts: 6
regular expression

hi,
I need a regular expression that returns the user name(s) only!!!
from the output of the "who" command.


user name
ronajt pts/1 Apr 21 14:50
root pts/2 Apr 21 14:52
dorint pts/3 Apr 21 14:52
allago pts/4 Apr 21 15:01
root pts/9 Apr 21 11:53
  #2 (permalink)  
Old 04-21-2004
Brandt Brandt is offline
Registered User
  
 

Join Date: Jan 2004
Posts: 8
sorry if i misunderstood expression, but would

who|grep -v "user name"|awk '{print $1}' suffice?
  #3 (permalink)  
Old 04-21-2004
Optimus_P Optimus_P is offline Forum Advisor  
flim flam flamma jamma
  
 

Join Date: May 2001
Location: Chicago IL, USA
Posts: 1,006
Quote:
Originally posted by Brandt
sorry if i misunderstood expression, but would

who|grep -v "user name"|awk '{print $1}' suffice?
you can bypass the grep protion if you use the -u flag for the who command.
  #4 (permalink)  
Old 06-05-2008
abhisek.says abhisek.says is offline
Registered User
  
 

Join Date: May 2008
Posts: 9
Smile to get the usernames from who command

who | cut -d " " -f 1
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 11:24 AM.


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