This may depend on the version of sed
, but in the one I have handy (GNU sed version 4.1.5), you can write s/"[^"]*"/\U\0/
. For example, this Bash command:
sed 's/"[^"]*"/\U\0/g' <<< 'foo "bar" baz'
prints this:
foo "BAR" baz
There's not really much to explain except the \U
, which is a special feature that causes the subsequent text in the replacement-string to be capitalized, up to either \E
or end-of-string.