Hi, I'm just learning aspect and I'm having a hard time completing my script.
I want to copy text from the screen and use it later in a transmit command.
The systems that I am working on have a system name like (0114.008.01) SID#21>
Each system has a different name, and different length. I'd like to extract this, and use it later to download a database file and name it as the system name. Here is a copy of my script. I am manually entering in system names instead of grabbing the name thats output by the system.
proc main
string tftp
sdlginput "TFTP Server" "Enter TFTP Address" tftp
strcat tftp " "
pause 3
Connect telnet GROUP "SD NAV"
waitfor "^M^J"
transmit "^M"
waitfor " Login: "
transmit "*****^M"
waitfor " Password: "
transmit "******^M"
waitfor "> "
transmit "upload tftp config "
transmit tftp
transmit " "
call Nav1
transmit "^M"
waitfor "> "
transmit "exit^M"
endproc
proc Nav1
integer iDay, iMonth, iYear, iHour, iMin, iSec
string sFileName
ltimeints $LTIME iYear iMonth iDay iHour iMin iSec
strfmt sFilename "`"SD_Nav1_%d-%d`"" iMonth iYear
transmit sFilename
endproc
Instead of SD_NAV1 I'd like this to be the actual system name taken from the > prompt. Each system has a system name then > as a prompt. Here is a copy paste from the system once I'm logged in:
Carrier Access - Access Navigator
03:29:36 09/02/2004
Login: *******
Password: ********
(0114.008.01) SID#21> upload tftp config 4 "SD_Nav1_9-2004"
*-------------------------------------------^
(0114.008.01) SID#21>
Any help would be GREATLY appreciated. I've read over many pages here and found some things to do close to what I want, however I can't get them to work like I need since each system I log into has a different name.
I want to copy text from the screen and use it later in a transmit command.
The systems that I am working on have a system name like (0114.008.01) SID#21>
Each system has a different name, and different length. I'd like to extract this, and use it later to download a database file and name it as the system name. Here is a copy of my script. I am manually entering in system names instead of grabbing the name thats output by the system.
proc main
string tftp
sdlginput "TFTP Server" "Enter TFTP Address" tftp
strcat tftp " "
pause 3
Connect telnet GROUP "SD NAV"
waitfor "^M^J"
transmit "^M"
waitfor " Login: "
transmit "*****^M"
waitfor " Password: "
transmit "******^M"
waitfor "> "
transmit "upload tftp config "
transmit tftp
transmit " "
call Nav1
transmit "^M"
waitfor "> "
transmit "exit^M"
endproc
proc Nav1
integer iDay, iMonth, iYear, iHour, iMin, iSec
string sFileName
ltimeints $LTIME iYear iMonth iDay iHour iMin iSec
strfmt sFilename "`"SD_Nav1_%d-%d`"" iMonth iYear
transmit sFilename
endproc
Instead of SD_NAV1 I'd like this to be the actual system name taken from the > prompt. Each system has a system name then > as a prompt. Here is a copy paste from the system once I'm logged in:
Carrier Access - Access Navigator
03:29:36 09/02/2004
Login: *******
Password: ********
(0114.008.01) SID#21> upload tftp config 4 "SD_Nav1_9-2004"
*-------------------------------------------^
(0114.008.01) SID#21>
Any help would be GREATLY appreciated. I've read over many pages here and found some things to do close to what I want, however I can't get them to work like I need since each system I log into has a different name.