Bash Script

Hi,

im trying to setup a RBL DNS server for my testing.
im trying to write a bash scrip that add the IP's to add bind zone.

im having a prb transferring the ip in reveres format (192.168.1.2 -->
2.1.168.192)

can any one help me to do this with a bash script ?

thanks a lot
Kev

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo [at] vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Kev [ Mo, 21 November 2005 05:45 ] [ ID #1066484 ]

Re: Bash Script

On Mon, 2005-11-21 at 10:45 +0600, Kev wrote:
> Hi,
>
> im trying to setup a RBL DNS server for my testing.
> im trying to write a bash scrip that add the IP's to add bind zone.
>
> im having a prb transferring the ip in reveres format (192.168.1.2 -->
> 2.1.168.192)
>
> can any one help me to do this with a bash script ?

I don't know too much about RBL DNS servers, but changing the number
sequence around for an IP should be pretty easy:

#!/bin/sh

IP='192.168.1.2'
echo $IP|sed -r
's/^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$/\4.\3.\2.\1/'

Essentially, it performs a regular expression replace. It finds the four
groups of numbers and reverses the order (#4 goes first, #3 second,
etc.).

--
Chris Largret <http://daga.dyndns.org>

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo [at] vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Chris Largret [ Mo, 21 November 2005 09:10 ] [ ID #1066485 ]
Linux » gmane.linux.newbie » Bash Script

Vorheriges Thema: WMV File Extension
Nächstes Thema: MPG Video Format