need a sed guru to help me strip out words

Will Mc Donald wmcdonald at ntlworld.com
Thu Apr 22 16:07:47 UTC 2004


Something like...

sed 's/[0-9A-Z\(\)\:]//g'

would strip out digits, upper case characters and (, ) and :.

sed 's/[0-9A-Z\(\)\:]//g;s/^[ \t]*//g' 

Will do the same and remove leading whitespace too. This all assumes your usernames are all lowercase with no digits. 

Will

----- Original Message ----- 
From: "Eric Wood" <eric at interplas.com>
To: "Red Hat List" <redhat-list at redhat.com>
Sent: Thursday, April 22, 2004 4:41 PM
Subject: need a sed guru to help me strip out words


> # fuser -u SO*
> SODEI:  8952(whse) 23496(lhoover) 28450(recept) 28845(dschuetterle)
> 30835(awalter)
> SOLSI:  8952(whse) 23496(lhoover) 28450(recept) 28845(dschuetterle)
> 30835(awalter) 20242(ewood)
> 
> I need a sed formula to just list out the user names
> 
> # fuser -u SO* | sed 'something' | uniq
> whse
> lhoover
> recept
> dschuetterle
> awalter
> ewood
> 
> Any help is appreciated!
> -eric wood
> 





More information about the redhat-list mailing list