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 [EMAIL PROTECTED]
# 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


_______________________________________________
screen-users mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/screen-users

Reply via email to