#!/usr/bin/expect # Usage: ./sms.exp 123456789 "LOL, sms from hell" spawn telnet localhost 4242 expect "OpenBSC> " send "subscriber imsi [lindex $argv 0] sms sender id 1 send [lindex $argv 1]\r" expect "OpenBSC> " send "exit\r"