mirror of
https://github.com/rfivet/BCG101.git
synced 2024-12-17 23:56:24 -05:00
Update expect scripts for BASIC and FOCAL to work with sdf.org.
This commit is contained in:
parent
51078fe4e7
commit
fbf7bccb33
@ -6,7 +6,8 @@ if { $argv == "" } exit
|
|||||||
if [catch { set file [open $argv "r"]}] { puts $input ; exit }
|
if [catch { set file [open $argv "r"]}] { puts $input ; exit }
|
||||||
close $file
|
close $file
|
||||||
|
|
||||||
spawn telnet 192.168.1.6 4000
|
#spawn telnet 192.168.1.6 4000
|
||||||
|
spawn env vintage=tss8 ssh -o SendEnv=vintage menu@tty.sdf.org
|
||||||
#log_file session.log
|
#log_file session.log
|
||||||
set timeout 10
|
set timeout 10
|
||||||
expect "TTIX device, line " { sleep 1 ; send "\002s\r" }
|
expect "TTIX device, line " { sleep 1 ; send "\002s\r" }
|
||||||
|
54
expect/tss8-focal
Normal file
54
expect/tss8-focal
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
#!/usr/bin/expect --
|
||||||
|
# tss8-focal -- start a FOCAL session on tss8 by uploading a file
|
||||||
|
# Copyright (c) 2021-2024 Renaud Fivet
|
||||||
|
|
||||||
|
if { $argv == "" } exit
|
||||||
|
if [catch { set file [open $argv "r"]}] { puts $input ; exit }
|
||||||
|
close $file
|
||||||
|
|
||||||
|
#spawn telnet 192.168.1.6 4000
|
||||||
|
spawn env vintage=tss8 ssh -o SendEnv=vintage menu@tty.sdf.org
|
||||||
|
#log_file session.log
|
||||||
|
set timeout 10
|
||||||
|
expect "TTIX device, line " { sleep 1 ; send "\002s\r" }
|
||||||
|
while 1 {
|
||||||
|
expect {
|
||||||
|
"LOGIN PLEASE\r\n." { send "login 2003 tss8\r" ; break }
|
||||||
|
"\r\n." { send "KJ\r" }
|
||||||
|
timeout { send "\002s\r" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
expect "\r\n\r\n."
|
||||||
|
send "r focal\r"
|
||||||
|
expect "SHALL I RETAIN LOG, EXP, ATN ?:" { send "no\r"}
|
||||||
|
expect "SHALL I RETAIN SINE, COSINE ?:" { send "no\r"}
|
||||||
|
expect -ex "\r\n*" {
|
||||||
|
set file [open $argv]
|
||||||
|
while 1 {
|
||||||
|
if {[gets $file line] == -1} break
|
||||||
|
set line [string trimleft $line]
|
||||||
|
set line [string toupper $line]
|
||||||
|
set len [string length $line]
|
||||||
|
while {$len > 40} {
|
||||||
|
set outs [string range $line 0 39]
|
||||||
|
set line [string range $line 40 end]
|
||||||
|
incr len -40
|
||||||
|
send -- $outs
|
||||||
|
expect -ex $outs
|
||||||
|
}
|
||||||
|
|
||||||
|
if {$len > 0} {
|
||||||
|
send -- $line
|
||||||
|
expect -ex $line
|
||||||
|
}
|
||||||
|
|
||||||
|
send "\r"
|
||||||
|
expect -ex "\r\n*"
|
||||||
|
}
|
||||||
|
|
||||||
|
close $file
|
||||||
|
}
|
||||||
|
|
||||||
|
puts ">>>"
|
||||||
|
interact
|
Loading…
Reference in New Issue
Block a user