I have two variables
source_repo="fdl_ppe_01_04_repos_svc"
target_repo="fdl_ppe_01_10_repos_svc"
and I currently do a substitution within an XML file to replace all instances of $source_repo with $target_repo:
sed "s/$source_repo/$target_repo/g" $1 > $1_changed
How do I format the sed command so that it matches the pattern "fdl_ppe_01_XX_repos_svc" and replaces with $target_repo (XX can only be two digits)
...basically I don't want to have to define $source_repo in the script anymore
I'm struggling to understand sed syntax, so any help is appreciated!
source_repo="fdl_ppe_01_[0-9][0-9]_repos_svc"
, and always double quote your variable"$1"
.