Regarding the non-scholarly:
| sed 's/()/(No_DNS)/g' | tr -d '()'
Nmap writes parentheses with nothing between them when it receives no PTR
data for an IP address;
it also writes parentheses around an IP address whose PTR has been received.
My expression puts the IP addresses all in one column and the PTR responses
(including No_DNS) in
a different column.
Yes, it is redundant; I really should have written:
| sed 's/()/No_DNS/g' | tr -d '()'
There are still two expressions, and only two fewer characters among them.
Those sort -k 1's are indeed redundant, but writing the extra characters
reminds me to check where
the pertinent column actually is, and I don't perceive any harm in the
result.
Data buffers: I actually do understand, because I watch the System Monitor
while the nmap scans are
ongoing, and there's a dip in the network traffic about every 100 seconds,
presumably while those
buffers are being updated. The RAM usage climbs steadily as a number of
simultaneously running
scripts gather their multi-megabyte data. Also, losing network connectivity
does not cause errors
to appear in the accumulated data.
"the counts that uniq -c outputs are removed immediately after"
I have had trouble with sort -u and uniq -u, whereas uniq -c works every
time; and discarding
the counts doesn't tax the HDD because that write isn't otherwise saved.
"Save the script I wrote in a file ... "
Alas, the script puzzles me, partly because I can find no man page for "fi"
but mainly because it is
composed with shorthand expressions which I don't comprehend. As I rarely mix
nmap script executions
with other tasks, mainly because everything else is dramatically slowed down
when there are a dozen
scripts running, can I be assured that this sync script is a generalized one
that I don't have to
modify at all ? There won't be very frequent updates (think five minutes (5m)
because that would make
filename updates every 25 seconds while a dozen scripts are running; greater
frequency would have the
list of files changing too frequently.
After changing Magic Banana's sync program to increase the sleep interval to
five minutes (period=5m)
I saved it as filename.bin, made it executable with chmod +x filename.bin,
and tried to start it with
sudo .filename.bin ... alas, Terminal's response was "command not found." I
couldn't find that file
either ... ".filename.bin" is lost. I actually called it SyncIPv4.bin.
George Langford