The problem#
If you take the word
, reverse the order of the letters
and reverse the alphabet:wizard
From: abcdefghijklmnopqrstuvwxyz
To: ZYXWVUTSRQPONMLKJIHGFEDCBA
then you get the word
back, an observation made at least
as early as 1972.wizard
Now let's write a shell script to verify this so we can find other words with similar interesting properties. The obvious shell script to verify this
echo wizard | tr a-z z-a | rev
unfortunately fails with the error
tr: range-endpoints of 'z-a' are in reverse collating sequence order
The error is by design: it's not clear what a sequence in reverse order should mean, so POSIX actually requires that it not work.