E.g.,
Before After
--------------
emily-yellow.extension emily-yellow.anotherword.extension/possiblysomethingelse
Emily-yellow.extension Emily-yellow.anotherword.extension/possiblysomethingelse
emily-Yellow.extension emily-Yellow.anotherword.extension/possiblysomethingelse
Emily-Yellow.extension Emily-Yellow.anotherword.extension/possiblysomethingelse
Basically I want to preserve the case in the words
At least:
-the first letter in the entire keyword
-first letter after the -
-first letter of the extension
right now i'm writing the second keyword in lowercase in the see command but i want to keep it as the same case as the original. sometimes occurrences are the beginning of a sentence, some occurrences are not. if it is, i want to also be capitalised upon replacing
---------- Post updated at 12:23 AM ---------- Previous update was at 12:17 AM ----------
actually i have another problem
I'm doing something like
UPDATE $optionstable SET option_value = replace(option_value,"$BEFORE","$AFTER") WHERE wp_otpions.option_name = 'blogname';
but the problem is that this only replaces the specific case of "$BEFORE"
how can i make it case insensitive?
thanks
---------- Post updated at 12:51 AM ---------- Previous update was at 12:23 AM ----------
Okay, so this is what I'm trying now
blognamebefore = (i put in a sql command to grab the blog name)
This can be anything like "afdsdsfasdf BEFORE fafdsadffdsds"
then I'm trying to run a sed command that does a replace of the BEFORE keyword to the AFTER keyword
sed 's!${BEFORE}!${AFTER}!gI'
I want to preserve the case of the BEFORE word, at least the first letter would be good
how can I do this?
when I run the sed command, it changes the keyword into all lowercase letters
and I don't want to do this especially in the title
---------- Post updated at 12:55 AM ---------- Previous update was at 12:51 AM ----------
I think I managed something for now
I googled about how to use sed to capitalise the first letter of a word
then use that as my new keyword