I have a script for which I need to pass a string which contains variables and text to conform an URI.
An example of this would be:
URI="${PROTO}://${USER}:${PASS}@${HOST}/${TARGET}"
The variables ${PROTO}, ${USER}, ${PASS}, ${HOST} and ${TARGET} are not defined when I define the variable $URI but they will be when the Bash Script is going to be executed so I need to expand URI to the final form of the string.
How can I do that? I've read eval: When You Need Another Chance but I really don't like the idea of using eval as it might be dangerous plus it means to escape a lot of parts of the URI string.
Is there another way to do it? What's the recommended solution to this problem?
Thanks M