File: print_time.exp

package info (click to toggle)
arping 2.26-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,084 kB
  • sloc: sh: 4,691; ansic: 3,894; exp: 405; python: 142; makefile: 34
file content (14 lines) | stat: -rwxr-xr-x 277 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/expect -f

# Usage: print_time.ex arping 192.168.0.1

log_user 0
eval spawn $argv

expect {
       -re ".*\n" {
         send_user [clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S" ]
         send_user " $expect_out(buffer)"
         exp_continue
       }
}