Computing.Net > Forums > Unix > extract numbes

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

extract numbes

Reply to Message Icon

Name: sarahq
Date: September 25, 2007 at 07:48:17 Pacific
OS: uni
CPU/Ram: 9
Comment:

root:x:0:1:Super-User:/:/sbin/sh
daemon:x:1:1::/:
bin:x:2:2::/usr/bin:
sys:x:3:3::/:
adm:x:4:4:Admin:/var/adm:
lp:x:71:8:Line Printer Admin:/usr/spool/lp:
uucp:x:5:5:uucp Admin:/usr/lib/uucp:
nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico
listen:x:37:4:Network Admin:/usr/net/nls:
nobody:x:60001:60001:Nobody:/:
noaccess:x:60002:60002:No Access User:/:
nobody4:x:65534:65534:SunOS 4.x Nobody:/:
webber20:x:12447:200:web dev seminar:/home2/a/webber20:/bin/bash

how can i extrac long number after x:? so basically i need x:65534 from each line.



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: September 25, 2007 at 08:02:23 Pacific
Reply:

An awk script looking for the 3rd field will do it:

awk ' BEGIN { FS=":" } { print $3 } ' /etc/passwd



0
Reply to Message Icon

Related Posts

See More


string to integer join lines



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: extract numbes

Extracting File names www.computing.net/answers/unix/extracting-file-names/4597.html

Extracting string using regular exp www.computing.net/answers/unix/extracting-string-using-regular-exp/5762.html

Extracting lines from a file www.computing.net/answers/unix/extracting-lines-from-a-file/5403.html