You can redirect the output of any command (including 'nmap') to a file.
Append "&> file_name" (without the quotes and with the file name of your
choice) to the command line, to redirect what it writes on both the standard
and the error output.
That teenie little ampersand (&) is the key
You can also only redirect the standard output with '>' (or '1>') and only
the error output with '2>'. And you can use both:
$ command > standard_output 2> error_output
I wish there could be a scripted way of separating the two populations into
t
I do not understand the separation you want. Again: please give the expected
output given the input attached in your previous message (assuming it cover
all cases).
Input excerpt and expected output...
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.i
It is easy to get the two additional columns you asked for. With two
additional loops:
$ tr -sc 0-9\\n ' ' < hostname_list | awk '{ k = 0; for (i = 0; k < 4 && ++i
i; --k) printf $k "."; printf $k "\t"; while (++k
Just need to suppress that non-matching data ... which can be done with
LibreOffice Calc in post processing by sorting and the deleting the rows with
blank entries ...
Are you referring to the lines where my command line does not detect any IPv4
address? If so, 'grep' can be used at the ou
The "modification to complete" does not run nmap in parallel with the rest of
the command line. If you do not actually need "intermediate.txt", then
remove '> intermediate.txt' and give '-' (which here means "standard input")
to the -iL option. If you really want "intermediate.txt", then re
Read again the first paragraph of my previous post.
More generally, the following command line makes no sense:
$ command1 > file | command2 file
You want:
$ command | command2 -
Or, if you want to save the partial results (the output of 'command1', not
post-processed by 'command2'):
$ command
No. The command should be:
$ tr -sc 0-9\\n ' ' < hostname_list | awk '{ k = 0; for (i = 0; k < 4 && ++i
file | command2 file
As a consequence, it is possible that "file" does not even exist when
'command2' tries to read it. 'command2' would then end with an error.
For the fourth time, in the last command you give, you redirect the standard
output of 'grep '[0-9]$' to a file before a pipe: that is wrong and I do not
know how to explain it to you in a clearer way than what I attempted in my
three last posts.
Because there is an odd number of single quo
The tutorial you found is excellent. It never presents the execution of an
external command line from within AWK. It is actually possible, using the
"system" statement. You apparently only want to do do that (calling other
AWK programs, which themselves call 'nmap', etc.). I very much dou
And here''s the scorecard: CPV-GB-OneCol0-6192019-Resolved-Sort.ods ==> Three
hostnames that should have been found with Magic
Banana's script were somehow missed ("None ?).
It works here (hostname_list contains the first column of your spreadsheet):
$ ./find-IPv4-addr.awk hostname_list
178-137
> cat CPV-ThreeNone-Output.txt | more [and remove the intervening rows &
trailing dots with LibreOffice Calc]
I do not think you realize how much time of your life you could save by
seriously learning (say for ~10 hours) GNU's text-processing commands. I
understand you want to remove a dot
tee twixt - | dig -f twixt
That should be 'tee twixt | dig -f -' (or only 'dig -f -' if you do not want
to save "twixt"), for the same reason I explained you four times. If 'dig'
does not understand "-" as "standard input", write 'tee twixt | dig -f
/dev/stdin'.
... | grep -A1 "ANSWER SE
My dig scripts had been curtailed by a 'dig -' error caused because the twixt
file was getting chopped off mid-output, ending
I have been explaining you the problem (and its solution) many times now: the
commands on both side of a pipe, |, run in parallel: you cannot have command1
write a r
Some time ago, we worked out that I could run several awk commands like this
concurrently in separate terminal windows
Those command lines have nothing to do with awk.
Now I was planning to run concurrently several commands of the form
Again: there is no reason to divide the input. GNU's tex
17 matches
Mail list logo