开发者

sed + change small and capital letter

开发者 https://www.devze.com 2023-01-06 11:18 出处:网络
I hav开发者_运维问答e the following echo \"<x>small<X>capital\" | sed s\'/<x>/WORD/\'g

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'
0

精彩评论

暂无评论...
验证码 换一张
取 消