Reputation: 11002
Is it possible to run code when an expect script it terminated?
Given the following example;
#!/usr/bin/expect
while { true } {
puts "I am alive"
sleep 5
}
puts "I am dead"
This will continuously print "I am alive". When I press CTRL+C to kill the script, how can I call a function (or similar) to print "I am dead" on the way out?
Upvotes: 1
Views: 985