Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

typescript w/o the cursor trail

10 views
Skip to first unread message

Mathias Kőrber

unread,
Sep 20, 2012, 7:31:06 AM9/20/12
to
Is there a way to run script(1) (or port-process its output) so that it
leaves only the final commands submitted from the shell instead of also
containing the complete editing trail with cursor-escape-sequences etc?

All I'm really interested in is the actual command executed
but not how the user got there (whether they used comman-history,
editing etc is of no import). And of course the output of the commands.

Sure, I could ask then to run a 'set -x' in the typescripted shell, but
that is almost as ugly..

Barry Margolin

unread,
Sep 20, 2012, 10:05:32 AM9/20/12
to
In article <ac0d3s...@mid.individual.net>,
Try using "col -b" to post-process it.

script works by running the shell through a pseudo-tty, so it just sees
all the characters passing through, and doesn't know anything about the
application being run. For instance, if you ran Emacs or vi, there
wouldn't really be any "final commands".

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***

Mathias Kőrber

unread,
Sep 20, 2012, 10:25:20 AM9/20/12
to
On 20/9/12 22:05, Barry Margolin wrote:
>> Sure, I could ask then to run a 'set -x' in the typescripted shell, but
>> that is almost as ugly..
>
> Try using "col -b" to post-process it.

Thanks

Ah. better. col never made it sufficiently up on my horizon

It still seems to not know all sequences as the commandlines

> script works by running the shell through a pseudo-tty, so it just sees
> all the characters passing through, and doesn't know anything about the
> application being run. For instance, if you ran Emacs or vi, there
> wouldn't really be any "final commands".

Sure. I only really care what it does to shell prompt input (and
eliminate attempts to build a new command from history etc). Some of my
users seem to be *very* bad at typing, littering a simple commandline of
20 characters with at least 60 cursor edits etc.. Makes it hard to
follow what they did when it doesn't work and i need to see their input

cheers



0 new messages