Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^2: Wanted: humanly readable `script` output

by 5mi11er (Deacon)
on May 06, 2008 at 14:25 UTC ( #684957=note: print w/replies, xml ) Need Help??

in reply to Re: Wanted: humanly readable `script` output
in thread Wanted: humanly readable `script` output

Both ikegame and shmem also explained that what you are looking for isn't easily done. Yes perl (or any other language) can do it, and you're barking up the right tree looking at Term::Cap if you're determined to pursue actually creating this beast.

Let me attempt to shed some light on why this problem is "hard". If you look at your local linux /etc/termcap file, this is the configuration file for all the myriad "terminals" that have ever existed. By using libraries and this configuration file, it is possible to create your own display engine, and this is roughly how all the terminal emulation program(s) you might use all work; whether that is putty, SecureCRT (my fav.), or xterm (or not) on the unix console.

In my local copy there are over 1500 lines with terminal names/types. So, if you want this to be truly robust you have to be able to handle all those terminal types. Not easy, but with the help of libraries and the termcap file, it isn't as large a mountain as it might seem; but it's certainly not child's play.

Now, in your favor is the fact that in the real world, you're typically only going to care about a small subset of terminals, namely vt100/200/220 and xterm. Those are defacto standards today, but Linux and ANSI are two others that might also be widely used. That's still 6 different terminal protocols you have to deal with 100% correctly in order to be robust.

If you're still determined to sink a lot of time into this, the Putty source code is available, I suggest using that as a guide. Good luck.


  • Comment on Re^2: Wanted: humanly readable `script` output

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://684957]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2020-11-28 16:22 GMT
Find Nodes?
    Voting Booth?

    No recent polls found