[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: update doc about Solaris 'tr'

From: Ralf Wildenhues
Subject: Re: update doc about Solaris 'tr'
Date: Tue, 18 Aug 2009 20:42:15 +0200
User-agent: Mutt/1.5.20 (2009-08-09)

* 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]