I am trying to process IP addresses from traceroute,which writes to a file called td on disk,after which I do a
grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]*[0-9]*[0-9]' td | uniq
to get the list of unique IP addresses. Next i can get the geolocation data for the address by
lynx -dump http://api.hostip.info/get_html.php?ip=8.8.8.8
But now how do I feed the multiple outputs of the first into the second without needing to write to another file on the disk.
As an aside I was wondering if i could remove the file td completely and pipe traceroute output directly to grep somehow.
Can you use a shell
forloop?You can replace
$(cat td)with$(traceroute <options> | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]*[0-9]*[0-9]' | uniq)to avoid the intermediate filetd.