I m using sed inside expect script send command as mentioned below and getting the below error. Please let me know what am I missing here.
set new '"$Backend1Name"'
spawn ssh '"${userid}"'@'"$Backend1Name"'
expect "?*assword:*"
send '"$password\r"'
expect "?*~]# "
#puts [send -i $spawn_id "sed -i 's/\#rpc_address:.*/rpc_address:\ 10.31.201.219/' $file\r"]
send -i $spawn_id "sed -i 's/#rpc_address:.*/rpc_address:\ \$new/' /opt/APG/Databases/Cassandra/Default/conf/cassandra.yaml \r"
expect "?*~]# "
error:
sed: -e expression #1, char 30: unterminated `s' command
regsub(n)that performs substitutions within TCL... are you trying to rewrite the contents of the*.yamlfile?