SUMMARY: Converting terminal session caputure to printable characters

From: Dan O'Callaghan <>
Date: Tue Feb 03 2004 - 06:35:45 EST

>>>>I've used the "script" command to capture a terminal session.
>>>>I now need to print this info out.

>>>>Does anyone know of a utility to convert the screens character codes
to ASCII???

>>>>Thanks in advance.

Thanks to all those that replied.

therw were a couple of suguestions:
use unix2dos

col -b < typescript | lp
col is an ancient program for preparing text files for printers.

Thanks to Thomas who really pointed out my problem.
main ones that make things illegible (assuming you didn't try to script
something uses curses etc.), are carriage returns and backspaces.

I usually just edit these out in vi, using substitions
for carraige returns ^Ms
(the ^V^M means press control-V key combo, then control-M key combo;
I think they should just be deleted, so above works.  If not, try putting
\n or even \r in the replacement field)

For backspaces
You will need to repeat this until no longer matches.  (Unfortunately, you
cannot use a g flag at the end, we need to delete the 1st ^H and the
preceding only at each iteration).
<<end snip>>

One of the main problems I  have is that I used the "script" command to
record a tip session building a server.
Unfortunately, the installation program uses curses etc... which come out
as strange characters:

 A host name must be at least two characters; it can contain letters,
  and minus signs (-).^[[12;5HHost name: ^[[0;1;7m^O
^[[4C^[[0m^OF2_Continue    F6_Help^[[12;16H^[[0;1;7m^Otmpsrv1^H
^H2^[[7D^[[0m^Otmpsrv2^[[K^[[21;3H^[[H^[[2J^[[0m^Nq^[[C^[[0m^OIP Address

^[[2C^[[0m^OThe summary below is your current file system       and disk
layout, based on the
  information you've supplied.

  NOTE: If you choose to customize, you should understand file systems,
  intended purpose on the disk, and how changing them may affect the
  of the system.

        File system/Mount point           Disk/Slice             Size
        /^[[0;1;7m^O                                 c0t0d0s0
1328 MB
        ^[[0m^Oswap^[[30Cc0t0d0s1^[[13C296 MB
        overlap^[[27Cc0t0d0s2^[[11C34730 MB
        /export/home                      c0t0d0s7^[[11C33105
^[[5C^[[0m^OF2_Continue    F3_Go Back     F4_Customize    F5_Exit
F6_Help^[[12;9H^[[H^[[2J^[[0m^Nq^[[C^[[0m^OCustomize Disk: c0t0d0
^[[2C^[[0m^OBoot Device: c0t0d0s0

  Entry:^[[28CRecommended:^[[6CMB     Minimum:     MB
  Slice  Mount Point^[[17CSize (MB)
^[[41D0  /^[[32C1328
^[[41D1  swap^[[30C296
^[[41D2  overlap                         34730
^[[41D7  /export/home                    33105
                         Capacity:       34730 MB
                        Allocated:       34729 MB
^[[30DRounding Error:^[[11C1 MB
^[[20DFree:^[[11C0 MB

^[[5C^[[0m^OF2_OK    F4_Options    F5_Cancel

<<end example>>

Is there a better command to use than script for recording tip sessions
for builds?????
As "cat" and "more" can output the files to the screen correctly, is there
any way that the files be converted for correct viewing???
a simple  "cat build.output.file >> build.txt" just carries over the extra
What does cat do differently for output to screen?

Thanks in advance.

This message has been scanned by F-Secure Anti-Virus for Microsoft
For more information, connect to
sunmanagers mailing list
Received on Tue Feb 3 06:35:33 2004

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:29 EST