0

If I run the command bellow and my install.sh has the following section:

export S3_URL=$PRD_URL
export S3_ACCESS_KEY=$PRD_S3_ACCESS_KEY
export S3_SECRET_KEY=$PRD_S3_SECRET_KEY

cat install.sh | ssh $PRD_USER@$PRD_HOST

The $PRD_S3_ACCESS_KEY is going to be resolved from my host or the environment variables from the remote server?

3
  • 2
    Remote. Cat'ting doesn't evaluate the variables in the file. Commented Feb 16, 2020 at 20:45
  • @tink Is there any way to evaluate from my host? Commented Feb 16, 2020 at 20:47
  • 1
    If you rephrase your question above so it matches the comment @philippe's answer below does what you want ;) Commented Feb 16, 2020 at 22:29

1 Answer 1

2

Assuming you have gettext installed (which contains envsubst), you can do

envsubst < install.sh | ssh $PRD_USER@$PRD_HOST
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.