[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] Preserve escape characters in output
From: |
Tadziu Hoffmann |
Subject: |
Re: [Groff] Preserve escape characters in output |
Date: |
Fri, 4 Dec 2015 20:05:43 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
> Is there anything I can do to get groff to leave that escape
> character (ASCII 27/033) in the output?
As I understand the groff info file, this is very likely
impossible -- invalid characters (one of which is the ascii
escape character) are removed on input.
However: if you encode the escape as \N'27', nroff outputs a
real ascii escape character. So if you're generating the input
by some program, make it output \N'27' instead. If not, you
can try to preprocess the input with sed:
sed -e "s/^[/\\\\N'27'/g" file | nroff | od -c
0000000 Y Y Y 033 Z Z Z \n \n \n \n \n \n \n \n \n
0000020 \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
*
0000100 \n \n \n \n \n \n \n \n \n
0000111
where "^[" is supposed to be an ascii escape character.