I've never used expect scripting before and I'm trying to create a small script which has gone well except for this final part.
I have a key stored in the $key variable and I am trying to write this key to a file on the remote machine.
I've tried various puts command and bash scripts but nothing seems to work.
This following command is the closest I've come to success but it seems to do a return command at the pipe symbol (">"):
Any tips will be greatly appreciated?
I have a key stored in the $key variable and I am trying to write this key to a file on the remote machine.
I've tried various puts command and bash scripts but nothing seems to work.
This following command is the closest I've come to success but it seems to do a return command at the pipe symbol (">"):
Code:
send "echo $key > ~/.ssh/authorized_keys\r"
Any tips will be greatly appreciated?