Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!convex!convex.COM From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.unix.questions Subject: Re: Converting to uppercase/lowercase in sed Message-ID: <105048@convex.convex.com> Date: 17 Aug 90 09:33:54 GMT References: <3766@umbc3.UMBC.EDU> <1990Aug16.232151.23436@iwarp.intel.com> Sender: news@convex.com Reply-To: tchrist@convex.COM (Tom Christiansen) Organization: CONVEX Software Development, Richardson, TX Lines: 25 In article <1990Aug16.232151.23436@iwarp.intel.com> merlyn@iwarp.intel.com (Randal Schwartz) writes: >In article <3766@umbc3.UMBC.EDU>, rostamia@umbc5 writes: >| Is there a way to convert characters to uppercase or to lowercase in sed? > y/a-z/A-Z/ >uppercases the pattern space. You'll have to juggle the pattern and >hold spaces if you want just part of a line uppercased. > >Or get Perl. :-) Yes, the y command is a pain because of not being able to act on just part of a line. But, um, Randal has (understandably :-) been doing so much perl he's attributed perl intelligence to sed, which just isn't so. In sed you really have to do this: y/abcdefghijklmnopqrstuvxyz/ABCDEFGHIJKLMNOPQRSTUVXYZ/ And make sure they match up exactly. --tom -- "UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." [Doug Gwyn]