Computing.Net > Forums > General Hardware > Inline SED

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.

Inline SED

Reply to Message Icon

Name: Mose
Date: October 24, 2009 at 22:21:48 Pacific
OS: Linux
Product: Red hat Red hat linux 9 personal (full product)
Subcategory: General
Tags: sed, linux, UNIX
Comment:

Im trying to use SED in conjunction with DiG to obtain SOA servers, Im having a hard time finding the REGEX to pull the name server from the output of:
dig +noall +answer soa computing.net
computing.net. 86400 IN SOA ns1.theplanet.com. support.computing.net. 2009101500 1200 1800 86400 1200

Im trying to find a way to count from Left to Right and display only the 5th word (The name server) and strip the last "." from it



Sponsored Link
Ads by Google

Response Number 1
Name: Fist (by fmwap)
Date: October 24, 2009 at 23:15:48 Pacific
Reply:

Why not cut?

cut -d" " -f5 | sed 's/\.$//g'


0
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Inline SED

Fan Speed Software? www.computing.net/answers/hardware/fan-speed-software/25467.html

Hard Drive way too hot www.computing.net/answers/hardware/hard-drive-way-too-hot/27375.html

only Hlaf of memory showing up www.computing.net/answers/hardware/only-hlaf-of-memory-showing-up/34722.html