MCONV(1)

NAME
mconv - convert to/from MCONV BBS files

SYNOPSIS
mconv [-f] [-h|-t|-c] [-y] [-w WIDTH] [file...]
mconv -m [-h|-t|-c] [-g] [-n] [-w WIDTH] [file...]
mconv -a [-w WIDTH] [-H HEIGHT] [file...]
mconv -i [-g] [file...]
mconv [-u] mconv --version
mconv --help

DESCRIPTION
mconv processes the contents of each given file, or the standard input if none are given or when a file named `-' is given, and puts the result on the standard output. By default, mconv converts BBS attributes on the input to ANSI colour text on the output. This behaviour can be changed with the command line options.

OPTIONS
These first options determine the way that input data is processed.

-f, --file-input
    This is the default operation - each input file is assumed to be a normal MCONV BBS file, containing attribute codes, datestamps, and so on. The -h, -t, and -c options determine whether the output is to be HTML, plain text, or the default of coloured text. -y and -w also modify the output.

-m, --menu-input
    Each input file is assumed to contain MCONV menu code. The -h, -t, and -c options determine whether the output is to be HTML, plain text, or the default of coloured text. If the output is HTML, each menu item is a link to the relevant file, with `.html' appended to the filename. The -g and -w options also modify the output, and -d and -n specify whether to read an LDB file to show subscription and last access information in the output.

-i, --menu-info
    Each input file is assumed to contain MCONV menu code. On standard output, information about each menu - title, logfiles, entries and so on - is given. No conversion of attribute characters is done; the -h, -t, and -c options are ignored. This is primarily intended for use by other programs and/or by shell scripts.

-a, --ansi-input
    The input is assumed to be normal text containing ANSI colour codes and other escape sequences. It is always converted into normal MCONV attribute format; the only other options which have any effect when used with -a are the -w and -H options, which determine the size of the original terminal (which produced the incoming ANSI text), for the purpose of working out which lines are datestamps, handling scrolling, and so on. This option is useful for converting session logs to viewable files; for instance, turning a screenlog file created by screen(1) into something to be viewed by mview(1).

The next few options determine the output format.

-h, --html-output
    (-f and -m only)
    When processing files and menus, output HTML. The resultant HTML will be surrounded by a <pre> tag, thus preserving the formatting. Menu code will have links put to each menu item, as described above in the description of the -m option.

-t, --text-output, --no-colour
    (-f and -m only)
    Menus and files are output as plain text only, with no colour codes.

-c, --colour-output
    (-f and -m only)
    Menus and files are output as text containing ANSI colour codes. This is the default output format for -f and -m processing.

These options slightly modify the behaviour of the input parser:

-y, --anonymous
    (-f only)
    Strip the account names from From: lines.

-g, --guest
    (-m and -i only)
    Output the menu as a guest user would see it.

-d, --ldb=FILE
    (-m only)
    Read last-access information from FILE. If MCONV_LDB or MVIEW_LDB are set, they contain the default LDB filename (the former takes precedence). This option overrides any environment variables.

-n, --no-ldb
    (-m only)
    Do not use any last-access information; mark all menu entries as up to date and subscribed to.

-u, --unbuffered
    (standard input only)
    Do not line buffer the input or the output.

-w, --width=NUMBER
    For file and menu input (-f and -m), change the number of columns in the output from the default of 80 to NUMBER. For ANSI colour text input (-a), change the number of columns that the input text is assumed to have from the default of 80 (or the value of $COLUMNS) to NUMBER.

-H, --height=NUMBER
    For ANSI colour text input only (-a), change the number of rows that the input text is assumed to have from the default of 25 (or the value of $LINES) to NUMBER.

The last two options give information about the program.

--help
    Print a usage message on standard output and exit successfully.

-V, --version
    Print version information on standard output and exit successfully.

ENVIRONMENT
The following environment variables are important to menu code conversion with mconv -m:

MCONV_USER
    The username to process the menu for. Used when expanding .IF USER constructs. If not set, the current username is used. Note that this is ignored if the -g flag is passed.

MVIEW_USER
    As above; used for compatability with mview(1). If both this and MCONV_USER are set, MCONV_USER takes precedence over this variable.

MCONV_LDB
    The last access database to read information about menu entries from. Can be overridden with the -d option, and switched off altogether with -n.

MVIEW_LDB
    As above; used for compatability with mview(1). If both this and MCONV_LDB are set, MCONV_LDB takes precedence over this variable.

The following environment variables are important to session log conversion with mconv -a:

COLUMNS
    The default terminal width. Can be overridden by -w or --width. If this variable is not set, the default width is 80.

LINES
    The default terminal height. Can be overridden by -H or --height. If this variable is not set, the default height is 25.

Note that the environment variables COLUMNS and LINES are automatically set by some shells, notably bash(1).

EXAMPLES
If your online time is limited and you want to re-read your telnet session offline, then a simple way of doing it is to log your session somehow (ways are described below), and then use mconv -a to convert the log into an mview-able file, like this:

    mconv -a < ~/screenlog.0 > ~/session.log
    rm ~/screenlog.0
    mview ~/session.log

Assuming of course that ~/screenlog.0 was your log file and you want the viewable output to go into ~/session.log. To log your session there are two possibilities: screen(1) or tee(1). The former is more reliable but a little more complicated and of course impossible if you don't have screen installed on your system. Using screen to create the log involves running screen as usual, then typing ^A H to turn on logging. Next, log into your remote system as usual, do your usual thing, and log out. Type ^A H again to turn off logging, and type `exit' to terminate screen. You will now have a session log file, most likely called ~/screenlog.0. Alternatively, using tee is much easier; just type the following:

    telnet some.where.com | tee ~/screenlog.0

Or, to do the whole conversion in one step, how about this:

    telnet some.where.com | tee /dev/tty | mconv -a > session.log

There should be enough there for you to grasp the basic use of `mconv -a'.

BUGS
The terminal emulation of the `vt100' library is not complete, so conversions using mconv -a may trip up on some unsupported escape sequences. Some menu commands are ignored or unimplemented - see the mview(1) manual page and the extra documentation supplied with the package for full details.

AUTHOR
Andrew Wood <mconv@ivarch.com>
mconv: http://mconv.sourceforge.net/

SEE ALSO
mview(1), mbbs(1), mgid(1), mtrunc(1), mtime(1), mte(1), screen(1)