Re: sed/Solaris case insensitive search

  • From: "Ranko Mosic" <ranko.mosic@xxxxxxxxx>
  • To: "Radoulov, Dimitre" <cichomitiko@xxxxxxxxx>
  • Date: Fri, 30 Jun 2006 14:59:46 -0400

You the man Dimitre.  This works !!!  Thanks very mych.

Regard, Ranko.


On 6/30/06, Radoulov, Dimitre <cichomitiko@xxxxxxxxx> wrote:

> 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





--
Regards,
Ranko Mosic
Contract Senior Oracle DBA
B. Eng, Oracle 10g, 9i Certified Database Professional
Phone: 416-450-2785
email: mosicr@xxxxxxxxxx
http://ca.geocities.com/mosicr@xxxxxxxxxx/ContractSeniorOracleDBARankoMosicMain.html

Other related posts: