I’m using nmap for network reporting with something like the below example:
nmap 192.168.1.0/24 -oG filename_$(date +'%d-%m-%Y-%T').txt
How do I add the network scanned into the name of the file created? So for example, the file created looks like 192.168.1.0/24_07-01-2022.txt
Thanks!
/
is one of only two characters that cannot appear in a file name.\0
is the other. You cannot create the file as hoped for. You can runNET=192.168.1.0 nmap ${NET}/24 -oG f${NET}_$(date %d-%m-%Y-%T).txt
– doneal24 Apr 07 '22 at 15:50192.168.1.0
would be a directory and24_07-01-2022.txt
a file in that directory. I suspect that isn't what you want. – terdon Apr 07 '22 at 15:57