1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/bin/sh ECHO_LINE=y netstat -rn 2>&1 | while read -r line do case "$line" in "Internet6"*) unset ECHO_LINE ;; "Routing tables"*|"Internet"*) : ;; *[![:space:]]*) if [ "${ECHO_LINE}" ] then echo "$line" fi ;; esac done