I have a variable that is a url and i want to replace part of that url in bash, but i keep getting "bad substitution"
URL="http://hostname/project/branches/Old_Branch/package"
SRC="Old_Branch"
REP="New_Branch"
echo ${$URL/$SRC/$REP};
# desired output is http://hostname/project/branches/New_Branch/package
Not sure exactly where I'm going wrong...
URL="http://hostname/project/branches/Old_Branch/package"
SRC="Old_Branch"
REP="New_Branch"
echo "${URL/$SRC/$REP}"
Note no $ sigill for URL in ${} =)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With