I need to evaluate output data to the screen to help automate my procedure.
I have looked at the terminal commands to evaluate strings and integers but I am still not sure how to proceed.
In one case I will take the output that gives me a terminal ID (an integer from 1 to 24).
I want to capture the terminal number value so I can use it to invoke the next command to change the config of that terminal and later to change the terminal config back.
The output to Procom will look something like this:
User logged in on terminal #3
I then need to put the 3 in a command to re-config the terminal useing a comand something like this:
chg-term;term-3;logs-off
In the second case I will get line after line of cards with the status of each (maybe 60 or 100 lines or even more). I then want to only look at the cards that have a fault or are out of service. There could be several pages of cards (each card is just one line).
Example
command
card-stat;card;all
output
Card 102 blah balh blah In-Service
Card 103 blah balh blah fault
Card 104 blah balh blah Out-of-Sevice
Card 105 blah blahh blah In-Service
.
.
Card 613 blah balh blah fault
Card 614 blah blahh blah In-Service
For each card out of service or that has a fault status I need to execute a command as follows and then move on.
command
card-stat;card-102
output
card 102 blah
blah blah
blah blah
blah blah
I am not sure that the value will always be in the exact same col on the screen - but I think so. However the string will always be the same except in the case of the terninal the terminal # will be from 1 - 24.
Any ideas?
I have looked at the terminal commands to evaluate strings and integers but I am still not sure how to proceed.
In one case I will take the output that gives me a terminal ID (an integer from 1 to 24).
I want to capture the terminal number value so I can use it to invoke the next command to change the config of that terminal and later to change the terminal config back.
The output to Procom will look something like this:
User logged in on terminal #3
I then need to put the 3 in a command to re-config the terminal useing a comand something like this:
chg-term;term-3;logs-off
In the second case I will get line after line of cards with the status of each (maybe 60 or 100 lines or even more). I then want to only look at the cards that have a fault or are out of service. There could be several pages of cards (each card is just one line).
Example
command
card-stat;card;all
output
Card 102 blah balh blah In-Service
Card 103 blah balh blah fault
Card 104 blah balh blah Out-of-Sevice
Card 105 blah blahh blah In-Service
.
.
Card 613 blah balh blah fault
Card 614 blah blahh blah In-Service
For each card out of service or that has a fault status I need to execute a command as follows and then move on.
command
card-stat;card-102
output
card 102 blah
blah blah
blah blah
blah blah
I am not sure that the value will always be in the exact same col on the screen - but I think so. However the string will always be the same except in the case of the terninal the terminal # will be from 1 - 24.
Any ideas?