In expect it is possible to spawn a process like,
spawn /usr/bin/sftp "$uri" /home/user/dest
Writing it like this makes things really simple, it will be a one liner. However, I am trying to replicate this for upload. This is a bit more complicated,
spawn /usr/bin/sftp "$uri" <<< $'put "$source"'
Most likely the issue is that this is bash code and not a single command. Is there a way to spawn something like this in expect, or will I have to do it the long way? I also tried with braces, to no success.