extracting usernames with at least 4 characters


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting extracting usernames with at least 4 characters
# 1  
Old 05-23-2006
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
# 2  
Old 05-23-2006
See the regex usage in this thread - question on egrep

Last edited by vino; 05-23-2006 at 10:41 AM..
# 3  
Old 05-23-2006
may be this

who | awk 'length($1) >=4'
# 4  
Old 05-23-2006
Continuing with your original line of thought...note the spaces...

who | grep "^[^ ]\{4,\} "
# 5  
Old 05-24-2006
Quote:
Originally Posted by hegemaro
Continuing with your original line of thought...note the spaces...

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

Thanks that works great.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Extracting range of characters if pattern matches

Im trying compare values between files and if they match I want to extract some characters in between those values for many files. They are in two directories and have the name filename but one ends in .enr. They look like this. cat bat.1.enr name,start,end bat.1,231, 234 and another... (5 Replies)
Discussion started by: verse123
5 Replies

2. Shell Programming and Scripting

Extracting characters and storing in some variable

eg: ./myProgram.sh filename.cpp I want to remove the :".cpp" extension from the filename.cpp expected output: filename (3 Replies)
Discussion started by: umesh314
3 Replies

3. UNIX for Dummies Questions & Answers

[Solved] Extracting all characters from a string

I want to extract the string TC from the string TC10, the string can have any characters out of . I used the following code but didnt get the right output. Please guide nuc=match(val,/*/) seq=substr(val,RSTART,RLENGTH) ---------- Post updated at 09:40 PM ---------- Previous update was... (0 Replies)
Discussion started by: newbie83
0 Replies

4. Shell Programming and Scripting

Extracting data between two characters

From the command line how would I extract data in file that was contained between parenthesis "()"? Awk or Grep? Thanks in advance Ted (11 Replies)
Discussion started by: TedSD
11 Replies

5. Shell Programming and Scripting

Extracting specific characters from a text file

I'm extremely new to scripting and linux in general, so please bear with me. The class I'm taking gives virtually no instruction at all, and so I'm trying to learn everything off the web. Anyway, I'm trying to extract characters that follow after a specific pattern ( '<B><FONT FACE="Arial">' ) but... (3 Replies)
Discussion started by: livos23
3 Replies

6. UNIX for Advanced & Expert Users

Usernames in Sudoers have #

We have users that have a # in their username. Sudo is working on some servers and not others. I have narrowed it down to the # in their username. Any suggestions or ideas why it is working on 1 server but not another. Server not working is - Solaris 10 patch level 138888-01 Server working is ... (1 Reply)
Discussion started by: Gibby13
1 Replies

7. UNIX for Dummies Questions & Answers

Advice on extracting special characters from a DB2 table to a file in the UNIX ENV

need some advice on the following situation. I have a DB2 table which has a varchar Column. This varchar column can have special characters like , , . When I extract from this table to a sequential file for this varchar column I am only able to get and . To Get the ... (1 Reply)
Discussion started by: cosec
1 Replies

8. UNIX for Advanced & Expert Users

Usernames across Applications

Hello everyone, I was just wondering if there was a way to make it so that usernames could be used across applications. For instance, I have a server that has a bunch of users. I want these users to have ways of accessing my database as well as a variety of other programs, but I don't want them... (2 Replies)
Discussion started by: gonzofish
2 Replies

9. UNIX for Dummies Questions & Answers

extracting few characters from a file

i want to extract few characters from a file based on a special character like || how to do it suggestions please (4 Replies)
Discussion started by: trichyselva
4 Replies

10. UNIX for Advanced & Expert Users

Usernames and processes most used

I need a command that returns the usernames that have ran the 10 processes that have taken the most time to execute on a machine. I also need a command that returns only those directories that have read/execute permissions for all the users. (4 Replies)
Discussion started by: anw68ster
4 Replies
Login or Register to Ask a Question

Featured Tech Videos