View Single Post
  #1  
Old 05-15-2019, 03:24 AM
Zander Zander is offline
Registered User
 
Join Date: Oct 2016
Posts: 11
Extracting Multiple Strings from Output / Text File

Hi all,

I'm currently writing a script that runs a command on a remote host and needs to pull out every occurrence of a certain string. I see two ways of doing this: #1 - All within the script or #2 - Exporting an output to a text file and then grepping (or the VBScript equivalent) for the lines that contain the string I'm looking for

So I'm running the equivalent of a
Code:
show run
and need to pull out every line that contains
Code:
ip route-static
as a single or, if it's easier, separate variables. Is this possible? I've had a long Google session and haven't been able to spot anything similar out there!

Thanks in advance,
Zander
Reply With Quote