I'd like to use ripcal to convert the IP ranges in a file on all ASNs into CIDR notation. Unfortunately, ripcal does not have clean output (I may modify it).
Running it with IPs as an argument:
ripcal 1.0.181.0-1.0.182.255
1.0.181.0-1.0.182.255 = 1.0.181.0/22
1.0.181.0/22 = 1.0.180.0 - 1.0.183.255
Running it with IPs passed in on STDIN:
echo "1.0.1.0-1.0.3.255" | ripcal
1.0.1.0/22
1.0.1.0/22 = 1.0.0.0 - 1.0.3.255
So in order to get the output I need, I must run something like echo $1 | ripcal | head -n 1 | tr -d "\n". Unfortunately, I cannot pass this in to teip by enclosing it in quotes and the shell will interpret the pipes such that the output of teip gets piped to head.
I'd like to use ripcal to convert the IP ranges in a file on all ASNs into CIDR notation. Unfortunately,
ripcaldoes not have clean output (I may modify it).Running it with IPs as an argument:
Running it with IPs passed in on STDIN:
So in order to get the output I need, I must run something like
echo $1 | ripcal | head -n 1 | tr -d "\n". Unfortunately, I cannot pass this in to teip by enclosing it in quotes and the shell will interpret the pipes such that the output ofteipgets piped tohead.