Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!ucbvax!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.unix.questions Subject: Re: Converting to uppercase/lowercase in sed Message-ID: <1990Aug16.232151.23436@iwarp.intel.com> Date: 16 Aug 90 23:21:51 GMT References: <3766@umbc3.UMBC.EDU> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 22 In-Reply-To: rostamia@umbc5.umbc.edu In article <3766@umbc3.UMBC.EDU>, rostamia@umbc5 writes: | Is there a way to convert characters to uppercase or to lowercase in sed? | In EX the command | s/asdf/\U&/ | changes the string asdf to ASDF, but ed and sed do not seem to be as | sophisticated as ex :-( | | Any ideas? yeah, the not very well documented "y" command. 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. :-) -- /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ | on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | \=Cute Quote: "Welcome to Portland, Oregon, home of the California Raisins!"=/