I have a text file:
example.txt
UserName = JIU62H123;
USER_NAME = JIU62H123;
I need to change JIU62H123
to A5B4C6DF9
. Obviously, for this file I could just do:
//bash
sed -i '' 's/JIU62H123/A5B4C6DF9/g' example.txt
This works for this file as you can see from the result:
example.txt
UserName = A5B4C6DF9;
USER_NAME = A5B4C6DF9;
However, in actuality, I won't know if the username is actually ahead of time. All I know is that the file is in this shape:
example.txt
UserName = <some_letters_and_numbers>;
USER_NAME = <some_letters_and_numbers>;
I basically need to change <some_letters_and_numbers>
to A5B4C6DF9
. Can this be done with one or more sed
commands?