[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: BUG in tr when lowercase letters 'o', 'p' & 'e' file names in the s
From: |
Eric Blake |
Subject: |
Re: BUG in tr when lowercase letters 'o', 'p' & 'e' file names in the same directory |
Date: |
Fri, 26 Jun 2009 11:57:54 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.22) Gecko/20090605 Thunderbird/2.0.0.22 Mnenhy/0.7.6.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Gaafer Goreish on 6/26/2009 11:43 AM:
> Following is the the simple commands used to re-produce this bug
The bug is in your lack of shell quoting, and not in tr. To see why this
is not a tr bug, you can do:
# echo hello | echo tr [:lower:] [:upper:]
>
> address@hidden:# echo hello | tr [:lower:] [:upper:]
You meant to use:
# echo hello | tr '[:lower:]' '[:upper:]'
Otherwise, the shell sees the unquoted [:lower:] as a glob, and if any
files happen to match the glob (in this case, the files ':', 'l', 'o',
'w', 'e', or 'r'), then glob expansion names those files rather than a
bracket expression.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkpFDCIACgkQ84KuGfSFAYCdswCfYzbMj4QlwTEuu8jon/POR4Ez
X3cAoLz+lPV1/zRQ5adCYAFaSMx8R4Ny
=SV3P
-----END PGP SIGNATURE-----