i have a config file with this format
http://link:port/username/password/1234
Im using this code to replace the Username1/Password1 with a different Username2/Password2
sed -i -e 's/\/Username1\/Password1/\/Username2\/Password2/g' /etc/config.cfg
Now i want to make this something like
$UsernameOLD = Username1
$PasswordOLD = Password1
$UsernameNEW = Username2
$PasswordNEW = Password2
sed -i -e 's/\/$UsernameOLD\/$PasswordOLD/\/$UsernameNEW\/$PasswordNEW/g' /etc/config.cfg
Could anyone help me getting this ready ?