LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   sed regular expression help needed (https://www.linuxquestions.org/questions/linux-newbie-8/sed-regular-expression-help-needed-307587/)

Dew 03-29-2005 09:52 PM

sed regular expression help needed
 
I am trying to make a sed script and have a question about doing a search and replace. I want to search for a word that starts with either upper or lower case (I know how to do that) and then replace it with another word that's first letter is of the same case as the original.

i.e. Smart becomes Dumb and smart becomes dumb.

Is there an easy way to do this with a one line command?

Thanks for the help!!!

Blinker_Fluid 03-30-2005 02:59 PM

probably more simplistic than you wanted but...
sed 's/Smart/Dumb/g' filename| sed 's/smart/dumb/g'


All times are GMT -5. The time now is 10:24 AM.