sed/Solaris case insensitive search 2006-06-30 - By Radoulov, Dimitre
Back > I need to modify certain file using sed. Pattern can be both upper/lower > case. > Sun Solaris sed doesn't have /I switch that GNU sed has. > Does anybody know how to perform sed insensitive search ?
$ cat text1 UNIX uNiX $ sed s/[Uu][Nn][Ii][Xx]/Solaris/ text1 Solaris Solaris
$ tr "[:lower:]" "[:upper:]" < text1 | sed s/UNIX/Solaris/ Solaris Solaris
$ sed -e s/UNIX/Solaris/ -e s/uNiX/Solaris/ text1 Solaris Solaris
Regards Dimitre
-- http://www.freelists.org/webpage/oracle-l
|
|