Sed replace - how to set new variable value in file?

Hello,

one line in the file “vlcrc” is:
input-title-format=$F

i want the sed command to define the value $U instead of $F but without explicitly defining current variable value, so the command should work universal no matter how the variable is set currently.

Please how that command should look like?

sed -i “???/???input-title-format=???/” vlcrc

Thank you in advance

sed s/input-title-format=$F/input-title-format=$U/ filename > filename.tmp ; mv filename.tmp filename
Try!


Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki