Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12141

Find and replace while preserving case with sed

$
0
0

I want to search and replace strings but keep the case intact using sed

For example, if I want to replace all occurrences of foo with bar, it should work like this:

foo --> barFoO --> BaRfOO --> bARFOO --> BAR

Viewing all articles
Browse latest Browse all 12141

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>