Let's say I have this text: My name is #1#!.
I want to replace the #1# with something that depends on the contents between the #, like:
if [ $thing_between_hash -eq 1 ]; then
subs=John
else
subs=Mary
fi
Then the output would be:
My name is John!
Can I do it with a single sed substitution? How?