I'm trying to run a command in a command line (just copy and paste the into moba xterm to remote Ubuntu machine). The command contains a line break, so I decided to use $(command). Here is the command I am trying:
docker build -t mytag --build-arg SSH_PRIVATE_KEY=$(cat <<EOF
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAy8QlGkj4OoK4/i3Sxhpag4k/S/SsDzjMwqM2Sc5qeE2EpuqH
@#$%$#^$%&^%*&^*&^%&(&)@#$%$#^$%&^%*&^*&^%&(&)@#$%$#^$%&^%*&^*&^
@#$%$#^$%&^%*&^*&^%&(&)@#$%$#^$%&^%*&^*&^%&(&)@#$%$#^$%&^%*&^*&^
@#$%$#^$%&^%*&^*&^%&(&)@#$%$#^$%&^%*&^*&^%&(&)@#$%$#^$%&^%*&^*&^
@#$%$#^$%&^%*&^*&^%&(&)@#$%$#^$%&^%*&^*&^%&(&)@#$%$#^$%&^%*&^*&^
KaAM3nF1tnWa1YhDRxOGaq6386hEdB/i05ZFdLjfSALo56UN7mC5
-----END RSA PRIVATE KEY-----
EOF
) .
I must paste an ssh key into the command somehow. The above command is not working; I get:
bad flag syntax: -----END
See 'docker build --help'.