0

Im my CI/CD configuration pipeline, I have this command in the script of the job :

- echo 'Acquire::http::Proxy "http://myproxy:8080";' >> /etc/apt/apt.conf.d/70debconf

I want to replace http://myproxy:8080 (without double quote) with a variable ${MY_VAR} but if i replace the proxy url by the variable, this one is not traduce

- echo 'Acquire::http::Proxy "${MY_VAR}";' >> /etc/apt/apt.conf.d/70debconf

Ther is simple quote and doubloe quote in the script ... how can I do ?

1 Answer 1

2

Use double quotes instead of single quotes

echo "Acquire::http::Proxy "${MY_VAR}";" >> /etc/apt/apt.conf.d/70debconf
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you It's OK. I have juste add escape char on the double quote arround the variable : echo "Acquire::http::Proxy \"http://${PROXY_SRV}\";" >> /etc/apt/apt.conf.d/70debconf

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.