[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to reverse an IPv4



On Mon 01 May 2023 at 02:24:18 (+0200), coreyh@free.fr wrote:
> I wrote this script for reversing an IP:

  $ IP='12.34.56.78'
  $ sed -E 's/([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/\4.\3.\2.\1/' <<<"$IP"
  78.56.34.12
  $ 

or REVERSE="$(↑↑↑that stuff↑↑↑)"

Cheers,
David.


Reply to: