merlyn@intelob.intel.com (Randal L. Schwartz @ Stonehenge) (04/04/89)
In article <426b0af2.142c4@retina.engin.umich.edu>, brian@caen (Brian Holtz) writes: | | Is there a way to uppercase the pattern text in the replacement text | with sed's substitute command? In ex/vi, you just say | s/regexp/\U&/ | but not, apparently, in sed/ed. You can capitalize *all* of the sed pattern space with y/a-z/A-Z/ which is not in the sed paper (if I remember right) but is tucked away on the sed manpage. To capitalize just a regexp takes a bit of work with sed. Use perl instead :-), as in: s/(regexp)/($y = $1) =~ y|a-z|A-Z|, $y/eg; (Thanks, Larry Wall...) -- /=====Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095========\ { on contract to BiiN (for now :-) Hillsboro, Oregon, USA. } {<@intel-iwarp.arpa:merlyn@intelob.intel.com> ...!uunet!tektronix!biin!merlyn } \=====Cute quote: "Welcome to Oregon... home of the California Raisins!"======/