tags:

views:

23

answers:

2

hi all

I have 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

+1  A: 
 echo "<x>small<X>capital" | sed s'/<[Xx]>/WORD/'g
ghostdog74
+1  A: 

In GNU sed, you can use a case-insensitive modifier:

echo "<x>small<X>capital" | sed 's/<x>/WORD/ig'
Dennis Williamson