Quantcast
Channel: Active questions tagged expect - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 159

Expect command: Setting multi-line environment variable of host

$
0
0

So I have an RSA token set in my environment variable. I want to set it in the environment of the remote machine. I tried this below script to set, but it only sets first line -----BEGIN OPENSSH PRIVATE KEY-----:

#!/usr/bin/expect -f

spawn ssh -tt ec2-user@$::env(EC2_INSTANCE)

send "export RSA_KEY=$::env(MY_KEY)\r"
expect -re ".*\$"

How can I set the whole content?


Viewing all articles
Browse latest Browse all 159

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>