The third column of "output-2-column-file.txt" cannot be computed from the input alone, as far as I understand. Is the script you want supposed to take the list of hostnames (the first column of beginning-5-col-file.txt) and compute what you call "literal IPv4"? If so, why is "ns530300.ip-198-27-67.net" mapped to 53.198.27.67? That makes little sense to me (and, indeed, 53 is not part of the actual address).

Defining the "literal IPv4" as the first sequence, in the hostname, of four numbers (separated by any number of other characters) that are all smaller than 256, I wrote that: $ tr -sc 0-9\\n ' ' < hostname_list | awk '{ k = 0; for (i = 0; k < 4 && ++i

Reply via email to