K
K
Konstantin2014-09-05 10:12:28
linux
Konstantin, 2014-09-05 10:12:28

How to parse an IP address in bash?

I am raising DNS and at the same time gaining experience in linux and bash. Unloaded a large zone from the windows-dns-server, which contains A-records on 2 subnets.
Actually, for future convenience, I want to write a script that would parse this unloaded zone and convert it into a PTR-readable file
Actually, you need to parse 192.168.20.10 and bring it to the result 10.20.168.192. Tell me how to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xotkot, 2014-09-05
@fallen8rwtf

something like this:

% echo "192.168.20.10" |awk -F. '{print $4"."$3"."$2"."$1}'
10.20.168.192

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question