.\" Copyright (c) 2001 Nik Clayton .\" All rights reserved .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $Id: scr2txt.1,v 1.2 2001/05/20 14:42:08 nik Exp $ .\" .Dd May 18, 2001 .Dt SCR2TXT 1 .Os .Sh NAME .Nm scr2txt .Nd convert a video memory dump to plain text (w/ optional ANSI codes) .Sh SYNOPSIS .Nm .Op Fl a .Op Fl l .Sh DESCRIPTION The .Nm utility reads a video memory dump, such as that created by the .Xr vidcontrol 1 utility, and converts it to plain text representation of the text from the screenshot. .Pp .Nm appends a newline character to the end of each line. .Pp .Nm reads from the standard input, and writes to the standard output. .Pp The following options are available: .Bl -tag -width -indent .It Fl a Emit ANSI colour escape codes to recreate the colours of the original screenshot. .It Fl l Replace any eight-bit line drawing characters with their closest seven-bit equivalents. This may result in odd output depending on the font in use when the screenshot was taken. .El .Pp See .Xr vidcontrol 1 for information about the input file format expected by .Nm . .Sh RETURN VALUES The .Nm utility exits 0 on success or >0 if an error occurred. .Sh EXAMPLES The command sequence: .Bd -literal -offset indent .Ic vidcontrol -p < /dev/ttyv0 > shot.scr .Ic scr2txt < shot.scr > shot.txt .Ed .Pp will capture the contents of the first virtual terminal, and redirect the output to the .Li shot.scr file. .Nm then processes this file, and writes the output to .Li shot.txt . Of course this could be rewritten as .Bd -literal -offset indent .Ic vidcontrol -p < /dev/ttyv0 \&| scr2txt > shot.txt .Ed .Pp This example will take a snapshot and remap the line drawing characters. .Bd -literal -offset indent .Ic vidcontrol -p < /dev/ttyv0 \&| scr2txt -l > shot.txt .Ed .Sh SEE ALSO .Xr scr2png 1 , .Xr vidcontrol 1 , .Xr syscons 4 , .Xr ascii 7 .Sh AUTHORS .An Nik Clayton Aq nik@FreeBSD.org .Sh BUGS When remapping eight bit characters to seven bit characters, .Nm should have more than one lookup table, depending on the font in use, and should be able to process a custom lookup table provided by the user.