Mailinglist Archive: opensuse (3637 mails)

< Previous Next >
Re: [SLE] [OT SED AWK BASH] How to trim out a line ending?
  • From: Adilson Guilherme Vasconcelos Ribeiro <adilson@xxxxxxxxxxx>
  • Date: Wed, 2 May 2001 16:20:15 -0300 (BRT)
  • Message-id: <Pine.LNX.4.10.10105021613340.27567-100000@xxxxxxxxxxxxxxxxxxxxx>


Today, Jonathan Wilson wrote...

>
> Ok, unfortunately nslookup spits out the desired info in 6 lines like such:
>
> Server: ns1.theplanet.com
> Address: 216.234.234.30
>
> Non-authoritative answer:
> Name: apple.com
> Address: 17.254.3.183
>
> [jw@garnet jw]$
>
you could try to use "host"... it's output is cleaner:

> host slashdot.org
slashdot.org has address 64.28.67.150
slashdot.org mail is handled (pri=10) by mail.upn.net
slashdot.org mail is handled (pri=20) by mail2.upn.net

if the host has more tan one ip the output will have many "xxx.xxx has
address 11.22.33.44" lines (try with www.us.kernel.org)

so you could do

for hosts in `cat hostnames`; do
host $hosts | grep address | awk '{print $4}';
done > output.txt

for example.

Best whishes
Adilson Ribeiro



< Previous Next >
References