delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/09/24/03:02:50

X-Spam-Check-By: sourceware.org
Subject: Re: tr command suddenly behaves differently
From: Jim Easton <jim AT cs DOT ualberta DOT ca>
To: cygwin AT cygwin DOT com
Date: Sun, 24 Sep 2006 01:02:23 -0600 (MDT)
CC: Jim Easton <jim AT cs DOT ualberta DOT ca>
X-Mailer: ELM [version 2.4ME+ PL66 (25)]
Message-Id: <S557806AbWIXHCX/20060924070231Z+8@sunkay.cs.ualberta.ca>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019