Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppressing the transmitted characters.

Status
Not open for further replies.

kevin906

MIS
Aug 4, 2006
167
0
0
US
This looks like a great place for this question and it's probably easy.

I simply want to have the script display a quick termmsg
to the user and submit a command string to the connected device. I don't want the user to see the command line being submitted, only the result of the command.

I have tried Set Aspect Display Off, but no luck.

I thought I had done this some time back but cannot remember how I did it.

Thanks for any help.

*********************************

proc main
CLear
set aspect display off
LOCATE 9 10

termmsg "*****************************`r`n"
locate 10 10
termmsg "*****************************`r`n"
locate 11 10
TERMMSG "FROM THE ROOT PROMPT OF THE SERVER ON and higher`r`n"
locate 12 10
TERMMSG "YOU CAN VIEW THE LICENSING FILES FOR ARS`r`n"
locate 13 10
TERMMSG "THE VALUES MAY ONLY BE CHANGED THROUGH A ISKETTE`r`n"
locate 14 10
TERMMSG "THIS COMMAND IS STRICTLY FOR VIEWING ONLY`r`n"
locate 15 10
TERMMSG "EDITS ON THIS FILE WILL RENDER IN-OPERABLE`r`n"
locate 16 10

TERMMSG "HIT ANY KEY`r`n"
locate 17 10
termmsg "*****************************`r`n"
termmsg "`r`n"
termmsg "`r`n"


keyget
TRANSMIT "some text to extract info^M"

ENDPROC
 
Set ASPECT Display OFF only affects characters that are received from the remote system and not those characters that Procomm is sending to it.

I know this is possible, but the method is escaping me at the moment, will post when I remember it.

 
Sorry I forgot about this! I poked through the help file again and didn't see any obvious way to do this. What might work is having an rget command after your transmit command. Rget will read the incoming string, which should be an echo of your command string from the remote system, and prevent it from being displayed on screen. You may need to tweak the default rget settings to make this work (see the rget help topic for more information).

 
I have done this is one of my scripts....I wanted to set a commands to a system running solaris (unix type operating system)....It took me a while but like knob said you can use rget....and I've inluced the 2 important parts of rget below....but basically rget will read incomming data until the set aspect rgetchar is reached..which by default is a carriage return...also I can't remember why but I had some problems with rget alone doing what I want so I combined it with set aspect RXDATA ON and it did exactly what I want..also In my code example at the end of this post ..Two import sections are:

1.
transmit "ls /usr/backup | grep -n 'bu' ; echo done ^m"

2.
while 1 ; Loop forever. This loops simply keep capturing the additional results of the grep command and when it finds
rget receiveLine ; the word done that means the grep command is finished...all this is kept from displaying on the screen.
if strfind receiveLine "done"
rget receiveLine $RXCOUNT
exitwhile
endif
endwhile
set aspect RXDATA OFF ; Give control back to procomm to handle port data.


If you will notice the transmit contains 3 commands the first transmit the commands to the unix server the second find the file with a .bu and the thid simply echo the command done ...so since my script is reading every line and not displaying it on the screen..it knows when it receives the line done ...then the command completed...so I've sent commands to the system and I've kept the user from see the command sent and kept them from seeing the results of the command...but through the whole process my script and use the data it retrived...hope this helps



---------------------------------------------------------
From Help:
rget completes when the character defined by set aspect rgetchar is received, when the specified number of characters are received or when the specified/default time expires. Execution continues with the next statement in the script.

----------------------------------------------------------
From Help:
aspect rgetchar character [STRIP]

Specifies the character which terminates an rget command. The default character is a Carriage Return, ASCII 13. If STRIP is specified, the terminating character is removed from the string returned by rget. fetch returns the current rget termination character as an integer.




-----------------------------------------
proc macsiiFromUnix
string receiveLine = ""
string rStoreNumber = ""


string modemstate
fetch modem connection modemstate


transmit "ls /usr/backup | grep -n 'bu' ; echo done ^m"

set aspect RXDATA ON ; Tell Aspect to handle port data.

rget receiveLine ; capture the backup command we just transmitted above to keep it from showing on screen
rget rStoreNumber ; capture the first result of the grep command on the backup listing which is all we need

if strfind rStoreNumber "done"
sdlginput "Could not determine store number" "Please enter the store number" rStoreNumber

rget receiveLine $RXCOUNT
set aspect RXDATA OFF ; Give control back to procomm to handle port data.

else
while 1 ; Loop forever. This loops simply keep capturing the additional results of the grep command and when it finds
rget receiveLine ; the word done that means the grep command is finished...all this is kept from displaying on the screen.
if strfind receiveLine "done"
rget receiveLine $RXCOUNT
exitwhile
endif
endwhile
set aspect RXDATA OFF ; Give control back to procomm to handle port data.



substr rStoreNumber rStoreNumber 5 9 ; extract the 9 digit store number from the string....example string 1:bu100001750.20070503
strdelete rStoreNumber 1 2 ; next take out the extra 2 zeros from the store number so we are left with just the 7 digit store number

endif

if strcmp modemstate "direct connect-Telnet" ; connect to the Avion and list out the files associated with this store
transmit "^]"
waitfor "telnet> "
transmit "!^M"
waitfor "$ "
transmit "cd /home/macsii^M"

waitfor "$ "

transmit "ls -l *"
transmit rStoreNumber
transmit "*^m"
else

;exitCallLogger(1);

winactivate "Procomm Plus Telnet : FALCONS"
if FAILURE
winactivate "Procomm Plus Telnet"
if FAILURE
winactivate "MACSII"
if FAILURE
exit
endif
endif
endif

mspause 500
strtoclip "cd /home/macsii"
sendkey SHIFT 0x2D EXTENDED
sendkey 0x0D
mspause 500
strtoclip "ls -l *"
sendkey SHIFT 0x2D EXTENDED
strtoclip rStoreNumber
sendkey SHIFT 0x2D EXTENDED
strtoclip "*"
sendkey SHIFT 0x2D EXTENDED
sendkey 0x0D
endif
endproc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top