Hi,
I need to to iterate over the files in a directory and perform the following replacement.
Before:
Hello ${USER_NAME}, you live at ${HOME_ADDRESS}. It is now ${TIME}
After:
Hello ${userName}, you live at ${homeAddress}. It is now ${time}
The number of different tokens that appear within ${} is large, so it's not really feasible to run:
find . -name '*' -exec sed -i 's/${USER_NAME}/${userName}/g' {} \;
find . -name '*' -exec sed -i 's/${TIME}/${time}/g' {} \;
etc.
I'm hoping it's possible to perform this replacement using a single command, that looks something like:
find . -name '*' -exec sed 's/XXX/YYY/g' {} \;
But I can't figure out what to substitute for XXX and YYY. Is it possible to do this in a single command?
Cheers, Donal