why expect shell script for 'obexctl' not working as Expected

673 Views Asked by At

I want to send a file using bluetooth from one device to another device. For that i am using obex which has a command called 'obexctl'. It works as described in this ... Please Take a look into this Doc

enter image description here

enter image description here

This is how sending file works. For automating this process i have written one shell script using expect. which is as below.

#!/usr/bin/expect -f
   set address [lindex $argv 0]
   set prompt "#"
   spawn obexctl
   sleep 2
   expect -re $prompt
   send "connect $address\r"
   sleep 5
   send "quit\r"

but it didnt work. It doesnt fully execute that connect command.and exit the code. Please let me know if any of you know the solution.

0

There are 0 best solutions below