Converting to uppercase/lowercase in sed

Maarten Litmaath maart at cs.vu.nl
Fri Aug 17 23:09:08 AEST 1990


In article <1990Aug16.232151.23436 at iwarp.intel.com>,
	merlyn at iwarp.intel.com (Randal Schwartz) writes:
)In article <3766 at umbc3.UMBC.EDU>, rostamia at 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/

Doesn't work on SunOS 4.0.3c and a whole lotta other UNIX versions.  :-(

	y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/

POSIX had better fix this...
--
   "UNIX was never designed to keep people from doing stupid things, because
    that policy would also keep them from doing clever things."  (Doug Gwyn)



More information about the Comp.unix.questions mailing list