anyway to keep quotations in a shell script while trying to write value?
#!/usr/bin/expect -f
set prompt "#"
set address 34:85:18:6a:52:52
spawn bluetoothctl
expect -re $prompt
send "connect $address\r"
expect "Connection successful"
sleep 2
send "list-attributes\r"
sleep 2
send "menu gatt\r"
sleep 2
send "select-attribute /org/bluez/hci0/dev_34_85_18_6A_52_52/service002e/char002f\r"
sleep 2
send "list-attributes\r"
sleep 2
send "write 0xa5 0x00 0x00 0x08 0x00 0x53 0x6f 0x0e 0x00 0x03 0x10 0x01 0x02 0x12 0x01 0x0a 0xff 0x01 0x20 0x9a\r"
send "quit\r"
expect eof
the write command needs to have " " around the value after write but the script will throw an error if added
write “0xa5 0x00 0x00 0x08 0x00 0x53 0x6f 0x0e 0x00 0x03 0x10 0x01 0x02 0x12 0x01 0x0a 0xff 0x01 0x20 0x9a” - works as intended from terminal but not from script i get error at that point of the code if i put quotations around it
anyone know an easy work around for this issue?