Hello.
Sorry if the title doesn't make sense. I have some code that grabs a command from a router and puts it into an @variable. My question is I want to only grab a certain part of the @variable. Here is some of the code:
@output2 = $fw->cmd('show conn count');
print @output2;
Which would show something like this:
123456 in use, 123456 most used
What I need to do is to grab the number 123456 bolded in use to use for a test condition. I also have another command that I need to do the same with but the numbers are
in a different order. Here is another snippet:
@output1 = $fw->cmd('show memory');
print @output1;
which would show something like this:
123456789 byte total, 123456789 in use
In this example I need to grab the bolded set of numbers and write it to a variable or a string.
Is this enough or do I need to expand on what I need? I did try to do a search but I'm not 100 percent sure what to search for.
Thanks,
Hal.
Sorry if the title doesn't make sense. I have some code that grabs a command from a router and puts it into an @variable. My question is I want to only grab a certain part of the @variable. Here is some of the code:
@output2 = $fw->cmd('show conn count');
print @output2;
Which would show something like this:
123456 in use, 123456 most used
What I need to do is to grab the number 123456 bolded in use to use for a test condition. I also have another command that I need to do the same with but the numbers are
in a different order. Here is another snippet:
@output1 = $fw->cmd('show memory');
print @output1;
which would show something like this:
123456789 byte total, 123456789 in use
In this example I need to grab the bolded set of numbers and write it to a variable or a string.
Is this enough or do I need to expand on what I need? I did try to do a search but I'm not 100 percent sure what to search for.
Thanks,
Hal.