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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transmit a command and save the result to a interger

Status
Not open for further replies.

Mjamm

IS-IT--Management
Dec 24, 2001
88
US
I need to write a simple script for a UNIX machince, that when I type. transmit "cat admin.cfg^M", then I could have the result write to a interger or string.
 
Here is a little script that worked for me when connected to a Unix machine. The rget command is repeated three times since it terminates when a ^M is read. In my situation, the script was seeing the echo of the ^M character, then the carriage return sent by the Unix machine to go to the next line, then the third CR was at the end of the line containing the single line from admin.cfg.

proc main
string sResponse

transmit "cat admin.cfg^M"
rget sResponse
rget sResponse
rget sResponse
usermsg "%s" sResponse
endproc

aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top