Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

listing logins

Status
Not open for further replies.

bluebonnet

Technical User
Feb 26, 2003
10
US
How would I list logins in my etc/passwd file that are 8 characters long? I am using the bash shell.


etc/passwd
 
This should do it:
[tt]gawk -F: '
{
if (length($1) == 8)
print $1
}' /etc/passwd[/tt] //Daniel
 
Thanks! I didn't have the command handy on how
to specify the length of the characters.
It works!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top