Re: tr A-Z a-z

2004-05-09 Thread Christoph P. Kukulies
On Sat, May 08, 2004 at 04:20:21PM -0500, Jose Lima wrote:
 I use:
 
 echo $Z | tr '[a-z' '[A-Z]'

This would be a lower case to upper case and would expose the same
problem. And a closing bracket is missing also. Don't know what the 
$Z should mean in your example.

In my example echo Z served as feeding a 'Z'  to the tr pipe.
But the problem is solved. As Kris suspected and someone else explained
it is a locale issue.

One should indeed use :lower: :upper: keywords. Or set the locale
accordingly for old shell scripts to work correctly.


--
Chris Christoph P. U. Kukulies kuku_at_kukulies.org
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: tr A-Z a-z

2004-05-08 Thread Jose Lima
I use:

echo $Z | tr '[a-z' '[A-Z]'

Jose Lima


On Fri, 2004-05-07 at 03:53, Christoph Kukulies wrote:
 Strange: I was used to do upper case lower case conversion always like this
 and it suddenly doesn't work anymore:
 
 $ echo Z | tr [A-Z] [a-z]
 
 
 
 --
 Chris Christoph P. U. Kukulies kuku_at_kukulies.org
 ___
 [EMAIL PROTECTED] mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: tr A-Z a-z

2004-05-08 Thread Julien Gabel
 Strange: I was used to do upper case lower case conversion always like
 this and it suddenly doesn't work anymore:

 $ echo Z | tr [A-Z] [a-z]

You can use special classes in this case too:
 $ echo Zz | tr [:upper:] [:lower:]

-- 
-jpeg.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


tr A-Z a-z

2004-05-07 Thread Christoph Kukulies
Strange: I was used to do upper case lower case conversion always like this
and it suddenly doesn't work anymore:

$ echo Z | tr [A-Z] [a-z]
ÿ


--
Chris Christoph P. U. Kukulies kuku_at_kukulies.org
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: tr A-Z a-z

2004-05-07 Thread vxla
On Fri, 2004-05-07 at 10:53:01 +0200, Christoph Kukulies proclaimed...

 Strange: I was used to do upper case lower case conversion always like this
 and it suddenly doesn't work anymore:
 
 $ echo Z | tr [A-Z] [a-z]

Works fine for me. However, maybe this would help?

echo Z | tr [:upper:] [:lower:]

-vxla
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: tr A-Z a-z

2004-05-07 Thread Kris Kennaway
On Fri, May 07, 2004 at 10:53:01AM +0200, Christoph Kukulies wrote:
 Strange: I was used to do upper case lower case conversion always like this
 and it suddenly doesn't work anymore:
 
 $ echo Z | tr [A-Z] [a-z]
 ÿ

Something locale-related?

Kris


pgp0.pgp
Description: PGP signature


Re: tr A-Z a-z

2004-05-07 Thread Christoph P. Kukulies
On Fri, May 07, 2004 at 03:57:25AM -0500, [EMAIL PROTECTED] wrote:
 On Fri, 2004-05-07 at 10:53:01 +0200, Christoph Kukulies proclaimed...
 
  Strange: I was used to do upper case lower case conversion always like this
  and it suddenly doesn't work anymore:
  
  $ echo Z | tr [A-Z] [a-z]
 
 Works fine for me. However, maybe this would help?
 
 echo Z | tr [:upper:] [:lower:]

Yes, that's how I also worked around it but it is dissatisfying :-)

$LANG=en_US.ISO_8859-1
$LOCALE=
$SHELL=/bin/sh


stty -a

speed 9600 baud; 36 rows; 80 columns;
lflags: icanon isig iexten echo echoe echok echoke -echonl echoctl
-echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo
-extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
brkint -inpck -ignpar -parmrk
oflags: opost onlcr -ocrnl -oxtabs -onocr -onlret
cflags: cread cs7 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
-dtrflow -mdmbuf
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = undef;
eol2 = undef; erase = ^?; erase2 = ^H; intr = ^C; kill = ^U;
lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q;
status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W;

FreeBSD-5.2.1 as well a half year old 5.2-current

--
Chris Christoph P. U. Kukulies kuku_at_kukulies.org
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: tr A-Z a-z

2004-05-07 Thread Christoph P. Kukulies
On Fri, May 07, 2004 at 01:59:01AM -0700, Kris Kennaway wrote:
 On Fri, May 07, 2004 at 10:53:01AM +0200, Christoph Kukulies wrote:
  Strange: I was used to do upper case lower case conversion always like this
  and it suddenly doesn't work anymore:
  
  $ echo Z | tr [A-Z] [a-z]
  ÿ
 
 Something locale-related?

locale
LANG=en_US.ISO_8859-1
LC_CTYPE=en_US.ISO_8859-1
LC_COLLATE=en_US.ISO_8859-1
LC_TIME=en_US.ISO_8859-1
LC_NUMERIC=en_US.ISO_8859-1
LC_MONETARY=en_US.ISO_8859-1
LC_MESSAGES=en_US.ISO_8859-1
LC_ALL=

echo Z | tr A-Z a-z | od -x
000  0aff
002

set

USER=kuku
SSH_CLIENT='137.226.9.123 53261 22'
MAIL=/var/mail/kuku
HOME=/home/kuku
SSH_TTY=/dev/ttyp1
PAGER=more
PS1='$ '
OPTIND=1
PS2=' '
LOGNAME=kuku
TERM=vt100
BLOCKSIZE=K
PPID=49204
PATH=.:/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11:/usr/local/bin:/home/kuku/bin:/usr/local/jdk1.1.5/bin:/usr/local/jsdk/bin:/usr/X11R6/bin
LANG=en_US.ISO_8859-1
SHELL=/bin/sh
IFS='   
'
CLASSPATH=.:/home/kuku/classes:/usr/local/jdk1.1.5/lib/classes.zip:/usr/local/jdk1.1.5/classes:/usr/local/jserv0.9.11/servclasses.zip:/usr/local/jsdk/lib/classes.zip
SSH_CONNECTION='137.226.9.123 53261 213.146.122.181 22'
FTP_PASSIVE_MODE=YES
EDITOR=vi

It must be something too obvious but I don't see it at the moment.

I found that it depends on my special environment settings.
A different user doesn't have this problem.


--
Chris Christoph P. U. Kukulies kuku_at_kukulies.org
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: tr A-Z a-z

2004-05-07 Thread Dan Nelson
In the last episode (May 07), Christoph P. Kukulies said:
 On Fri, May 07, 2004 at 01:59:01AM -0700, Kris Kennaway wrote:
  On Fri, May 07, 2004 at 10:53:01AM +0200, Christoph Kukulies wrote:
   Strange: I was used to do upper case lower case conversion always like this
   and it suddenly doesn't work anymore:
   
   $ echo Z | tr [A-Z] [a-z]
   
  
  Something locale-related?
 
 locale
 LANG=en_US.ISO_8859-1
 LC_COLLATE=en_US.ISO_8859-1

 echo Z | tr A-Z a-z | od -x
 000  0aff
 002

From the tr manpage:

 c-cFor non-octal range endpoints represents the range of
characters between the range endpoints, inclusive, in
ascending order, as defined by the collation sequence.

Note that 8859-1 has uppercase and lowercase accented characters, which
collate alongside the unaccented characters.
/usr/src/share/colldef/la_LN.ISO8859-1.src holds the collation sequence
for en_US.ISO_8859-1.  There are two lowercase y, but three uppercase
Y's.  This means that your ranges are different sizes, and Z maps to
y:, which happens to be 0xff in the 8859-1 charset.

 It must be something too obvious but I don't see it at the moment.
 
 I found that it depends on my special environment settings.
 A different user doesn't have this problem.

-- 
Dan Nelson
[EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]