Re: [PATCH 01/16] tr portability fixes
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Mar 13, 2008, 07:32 UTC
- Message-ID
- <47D8D895.4030309@viscovery.net>
- In-Reply-To
- <20080312212957.GB26286@coredump.intra.peff.net>
Jeff King schrieb:
Show 12 quoted lines
> We can mostly get around this by just using the bracket form > for both sets, as in: > > tr '[A-Z] '[a-z]' > > in which case POSIX interpets this as "'[' becomes '['", > which is OK. > > However, this doesn't work with multiple sequences, like: > > # rot13 > tr '[A-Z][a-z]' '[N-Z][A-M][n-z][a-m]'
Not that it matters a lot, but I wonder whether
tr '[A-M][N-Z][a-m][n-z]' '[N-Z][A-M][n-z][a-m]'
would have done the trick.
-- Hannes