How do I filter IPv4 IPs from data in bash?For example:command: dig www.ign.com A +shortreturn:www.ign.com.edgesuite.net.a1005.g.akamai.net.2.20.255.802.20.255.78And I want to make a bush script to put the return result to a txt file named a.list,which contain:2.20.255.802.20.255.78
How to filter IPv4 IPs in bash
bash;dns;dig
You can try:dig www.ign.com A +short | grep -oE \b([0-9]{1,3}\.){3}[0-9]{1,3}\b > a.listin your bash script. or refer to here.I think you mean bash not bush, right?