* Bruno Haible wrote on Mon, Aug 17, 2009 at 11:08:54PM CEST: > Ralf Wildenhues wrote: > > > On a Solaris 10 machine, I happened to not have /usr/xpg4/bin in front of > > > /usr/bin in my PATH. Consequence: The 'tr' program does not recognize > > > the POSIX (and BSD) syntax for character ranges. > > > > You can work around it by using the System V way of writing ranges: > > tr '[a-z]' '[A-Z]' > > > > which will work with both types of tr programs for this range. > > True. But I prefer (and recommend) the "follow the standards" policy. > In other words, I find it better to write my code according to the POSIX > standard, and choose tools that follow the POSIX standard, than to > write code in randomly annotated/hacked ways, so that non-POSIX tools > with museum value can be accommodated. For two reasons: > - Future code maintainers may wonder why I explicitly ask to transform > '[' into '[' and ']' into ']' and "optimize" this away. > - Random hacks have a tendency of becoming mutually incompatible. Try to > put 3 or 5 random hacks in the same place, sometimes there's no way out.
Thanks for explaining, that's all good reasoning. > If there was no /usr/xpg4/bin/tr on Solaris, then of course the situation > would be different, then one could only recommend > tr '[a-z]' '[A-Z]' > or > tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ And on Tru64/OSF, the situation is similar. Unless Eric has any comments regarding your patch, I can install it as is. Cheers, Ralf