The UNIX and Linux Forums  

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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
What is meant by the words under usernames? joeyg Post Here to Contact Site Administrators and Moderators 2 06-06-2008 08:55 AM
extracting few characters from a file trichyselva UNIX for Dummies Questions & Answers 4 01-03-2008 12:06 AM
Usernames and processes most used anw68ster UNIX for Advanced & Expert Users 4 03-13-2006 10:05 AM
extracting from tar.bz2 Raom UNIX for Advanced & Expert Users 1 03-07-2006 06:33 AM
max charachters for usernames m.szylkarski UNIX for Dummies Questions & Answers 1 02-01-2002 07:50 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-23-2006
Registered User
 

Join Date: Apr 2006
Posts: 34
extracting usernames with at least 4 characters

Hi,

i want to use grep to extract users with at least 4 characters in their username, i've tried who | grep \{4,\} but thats not working!!!!!!

Thanks
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-23-2006
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,643
See the regex usage in this thread - question on egrep

Last edited by vino; 05-23-2006 at 05:41 AM.
Reply With Quote
  #3 (permalink)  
Old 05-23-2006
Playing with Ubuntu Now!
 

Join Date: Oct 2005
Location: Chennai
Posts: 364
may be this

who | awk 'length($1) >=4'
Reply With Quote
  #4 (permalink)  
Old 05-23-2006
Registered User
 

Join Date: Feb 2006
Location: Schenectady, NY
Posts: 130
Continuing with your original line of thought...note the spaces...

who | grep "^[^ ]\{4,\} "
Reply With Quote
  #5 (permalink)  
Old 05-24-2006
Registered User
 

Join Date: Apr 2006
Posts: 34
Quote:
Originally Posted by hegemaro
Continuing with your original line of thought...note the spaces...

who | grep "^[^ ]\{4,\} "
Hi,

Thanks that works great.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 10:15 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0