I have created a automated login scripts that logges a user to several Telnet sessions "20" or more.
When the user used to Manualy login to this Telnet sessions he would have to select from several menus until he reached the destination. Example:
01 ) Northeast 02 ) West 03 ) South
Please make your selection >
At this point the user would use the numeric value for its destination. the he would get the next menu:
01 ) NewYork 02 ) New Jersey 03 ) Washington
Please make your selection >
Again the user would use the respective numeric value for its destination.
I had all this setup working using the predefined sequence of numbers.
like:
transmit "01"
waitfor "selection"
transmit "02" ...... and so on. It worked Fine until new network elements were added and it messed up the entire sequence of numbers.
Now I'm trying to create a Smart Script that will analize the terminal screen and search for example "Northeast" and then locate the respective number and then transmit it.
This way if Northeast's respective numeric value is changed the script will always transmit the correct number.
I found "strcspn" command that will compare 2 strings and locate the position where a single character is the same.
Is there a way to compare 2 string and locate the position where an entire word is the same?
Any help is appreciated
Thanks
Claudio
When the user used to Manualy login to this Telnet sessions he would have to select from several menus until he reached the destination. Example:
01 ) Northeast 02 ) West 03 ) South
Please make your selection >
At this point the user would use the numeric value for its destination. the he would get the next menu:
01 ) NewYork 02 ) New Jersey 03 ) Washington
Please make your selection >
Again the user would use the respective numeric value for its destination.
I had all this setup working using the predefined sequence of numbers.
like:
transmit "01"
waitfor "selection"
transmit "02" ...... and so on. It worked Fine until new network elements were added and it messed up the entire sequence of numbers.
Now I'm trying to create a Smart Script that will analize the terminal screen and search for example "Northeast" and then locate the respective number and then transmit it.
This way if Northeast's respective numeric value is changed the script will always transmit the correct number.
I found "strcspn" command that will compare 2 strings and locate the position where a single character is the same.
Is there a way to compare 2 string and locate the position where an entire word is the same?
Any help is appreciated
Thanks
Claudio