[comp.unix.questions] Re^2: Converting to uppercase/lowercase in sed

gedwards@ncratl.Atlanta.NCR.COM (Gordon Edwards) (08/28/90)

Dan_Jacobson@ATT.COM writes:

>merlyn@iwarp.intel.com (Randal Schwartz) writes:
>>yeah, the not very well documented "y" command.
>>	y/a-z/A-Z/
>
>bzzzzt. Minus 10 points! got to say:
>y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/
>-- 
>Dan_Jacobson@ATT.COM +1-708-979-6364

To convert lowercase to uppercase with sed I use

   s/[a-z]/[A-Z]/g

--
Internet: Gordon.Edwards@Atlanta.NCR.COM                  NCR Corporation
UUCP: uunet!ncrlnk!ncratl!gedwards                        2651 Satellite Blvd.
Amateur Radio: N4VPH                                      Duluth, GA  30136

merlyn@iwarp.intel.com (Randal Schwartz) (08/28/90)

In article <522@ncratl.Atlanta.NCR.COM>, gedwards@ncratl (Gordon Edwards) writes:
| To convert lowercase to uppercase with sed I use
| 
|    s/[a-z]/[A-Z]/g

Hmm.

$ echo 'Try this.' | sed s/[a-z]/[A-Z]/g
T[A-Z][A-Z] [A-Z][A-Z][A-Z][A-Z].
$

What weird version of Unix are you using?  (I'm not denying that it
may work on *some* Unix-like OS, but it doesn't work on the One True
Unix or BSD-derivatives or [blech] System V that I know of.)

#ifdef NEWSADMIN_NOTE
And, get your newsposter fixed.  "Re^2" is broke.  Phased out ages ago.
#endif

Just another UNIX hacker,
-- 
/=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!"=/

thomas@uplog.se (Thomas Tornblom) (08/28/90)

In article <522@ncratl.Atlanta.NCR.COM> gedwards@ncratl.Atlanta.NCR.COM (Gordon Edwards) writes:


   Dan_Jacobson@ATT.COM writes:

   >merlyn@iwarp.intel.com (Randal Schwartz) writes:
   >>yeah, the not very well documented "y" command.
   >>	y/a-z/A-Z/
   >
   >bzzzzt. Minus 10 points! got to say:
   >y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/
   >-- 
   >Dan_Jacobson@ATT.COM +1-708-979-6364

   To convert lowercase to uppercase with sed I use

      s/[a-z]/[A-Z]/g


Not with any sed I know of. I guess you don't mean to replace each lowercase
letter by the string '[A-Z]'.
Minus 10 pts!

Thomas
-- 
Real life:	Thomas Tornblom		Email:	thomas@uplog.se
Snail mail:	TeleLOGIC Uppsala AB		Phone:	+46 18 189406
		Box 1218			Fax:	+46 18 132039
		S - 751 42 Uppsala, Sweden