screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re [remove escape sequences from capture log]


From: christian (private)
Subject: re [remove escape sequences from capture log]
Date: Wed, 30 Aug 2006 13:42:31 +0200
User-agent: Thunderbird 1.5.0.5 (X11/20060812)

Dear Mark,

here is a small shell-script I wrote to get rid of the escape-sequences.

By far neither elegant nor sophisticated, but at least its working for me.

have fun

christian



#!/bin/sh

#################################################
#                 remove-escape                 #
#################################################
# this small script should remove most escape-sequneces by a file 
# I used it to get rid of the escape-chars genereated by the "screen" tool.
# file to clean is given via shell-parameter
# suggestions: please mail to address@hidden
# use at own risk. I am not responsible for any losses or damage caused by this 
script.
# I repeat: use at own risk!
############################
# 
# helpers is simply vim 
# the tr-tool is not any longer used here to do the job
#
# the script will create a backup-file with the .orig extension added.


if (( $# != 1 )) 
then
        echo "none or to many file(s) given as parameter"
        echo "usage ./remove-escape <file-to-clean>" 
        echo "will exit now" 
        exit 0
fi

cp $1 $1.orig
#removing ctrl-m (escape)
vi -c "%s/
//g" -c wq $1
#cat $1 | tr -d 
 > /tmp/out
vi -c "%s///g" -c wq $1
#cat /tmp/out | tr -d  > /tmp/out1
#cat /tmp/out1 | tr -d "[1" > /tmp/out2
#cat /tmp/out2 | tr -d ";5?r5?" > /tmp/out3
#cat /tmp/out2 | tr -d '\;5' > /tmp/out3
# the order is important here
vi -c "%s/\[52\;80H//g" -c wq $1
vi -c "%s/\[1\;52r//g" -c wq $1
vi -c "%s/\[1\;53r//g" -c wq $1
vi -c "%s/\[52;1H//g" -c wq $1



reply via email to

[Prev in Thread] Current Thread [Next in Thread]