I recently thought about a devious trick that involves setting the
PAGER envionment variable to
rev as a joke.
When I tried reading the man page for rev with
man rev I then saw the man page in reverse as expected.
If you want to try this without setting your pager you can use the
-P option in
man like so:
man -P rev rev and you will see the man page for
rev in reverse.
The thing that confuses me is that you cannot simply pipe the output through rev to get it the right way around again. I tried running
man -P rev rev | rev and instead of getting the output the right way around, it is still reversed.
There is an error message displayed the correct way around, it looks like this:
mdoc warning: A .Bl directive has no matching .El (#58)
I presume this is in the correct direction because it came through
stderr and not
If you simply pipe it through rev again, all of the text is in the correct direction, error message and all.
man -P rev rev | rev | rev
What is the reason for this odd behaviour?
I am using bash in gnome terminal on Ubuntu.