tr command suddenly behaves differently

Jim Easton jim@cs.ualberta.ca
Sun Sep 24 07:02:00 GMT 2006


Hi,

> According to Logu on 9/23/2006 4:46 AM:
> > After analysing I found that the tr command did not work correctly. So
> > the command
> > $ /usr/bin/tr [:upper:] [:lower:]

Sat, 23 Sep 2006 Eric Blake wrote
> There's your problem.  You didn't quote properly.  Try:
> $ echo [:upper:] [:lower:]
> to see what you were really invoking, then try:
> $ tr '[:upper:]' '[:lower:]'
> to do what you meant.

Pardon me for putting my oar in but the syntax of tr varies quite a
bit from system to system.  It has been my experience that the only
reliable way of expressing the above so that it will work on cygwin,
linux, solaris, sun4, aix and irix  is the following.  It's probably
more efficient to boot :-).

tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'

HTH
	Jim

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list