Magic Banana worries:

> I am not sure I understand what you mean by "It remains to be seen how to manage that so the interlopers are discarded".

Once the [long] command is done, it's too late to compare the [two or] three outputs from the nmap lookups of the candidate IP addresses [that I piped to the expedient intermediates.txt file]. That has to be done in-line with the main command.

> Does it mean removing every line having one single field if that line is preceded (or maybe followed: sort's ordering > depend on the localization of the system) by a line with the same first field? That is easy to do with a line of AWK > ... but, in the attached files, that would apparently remove all lines with one single field, i.e., all lines previously
> selected with 'grep'. That does not look right.

Definitely not right. In my expedient "solution" we need more steps to this process:

... | grep '[0-9]$' intermediate.txt | sudo nmap -sS -p3389 -iL intermediate.txt &> penultimate.txt | awk -f 'penultimate.txt' [i.e., pick the match and discard the non-matches of the nMap output] - > hostname-IPv4.txt | grep "Nmap scan report for"
hostname-IPv4.txt > Two-column-list.txt

That awk command should be easy to work out for someone familiar with the syntax ... I use the extraneous filenames to avoid
those hassles.

> Again, I would like an input (also to see what is sort's ordering), with all cases (lines that are discarded and lines
> that are not), and the respect[ive] output.

Here's a longer version; ftr05.txt is about 1/7th of the 4500-row "failed to resolve" data from the four-month data of 35,000 rows. Our analysis could just as well be applied to the 35,000 row file, once the inefficiencies are cleaned up:

time tr -sc 0-9\\n ' ' < ftr05.txt | awk '{ k = 0; for (i = 0; k < 4 && ++i

Reply via email to