sed + change small and capital letter
I hav开发者_运维问答e the following
echo "<x>small<X>capital" | sed s'/<x>/WORD/'g
How to change sed syntax in order to replace x and X with WORD
in this sed . sed replace only the small letter x
THX yael
echo "<x>small<X>capital" | sed s'/<[Xx]>/WORD/'g
In GNU sed
, you can use a case-insensitive modifier:
echo "<x>small<X>capital" | sed 's/<x>/WORD/ig'
精彩评论