Extract information out of an ssh command output in javascript

Viewed 15

I'm running a remote ssh command to get the routing table of a linux server using ssh2 and storing the output on a txt, the result txt file looks like this...

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         172.20.95.253   0.0.0.0         UG    0      0        0 eth0
234.234.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0
234.23.23.0     0.0.0.0         255.255.240.0   U     0      0        0 eth0

I can then read the txt file information with fs... the question is, how can i format the information to get the "destination" ips and discard the rest?

0 Answers
Related