Groups
Groups
Sign in
Groups
Groups
insteon-terminal
Conversations
About
Send feedback
Help
Non-Interactive Expect Script - Enjoy!
23 views
Skip to first unread message
Jay Simons
unread,
Dec 29, 2020, 12:08:19 AM
12/29/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to insteon-terminal
Here is an expect script I wrote to automate sending command to the console. It's rough but it works:
<pre><code>
#!/usr/bin/expect -f
set timeout 10
set cmd [lindex $argv 0]
spawn bash
expect "*#"
send "cd /usr/src/insteon-terminal\r"
expect "*#"
send "./insteon-terminal\r"
expect ">>>*"
send "$cmd\r"
expect ">>>*" {
after 1000
send "\r"
}
send "\r"
expect ">>>*"
puts "CMD_OK\r"
send "quit()\r"
expect "*#"
send "exit\r"
expect eof
</code></pre>
Reply all
Reply to author
Forward
0 new messages