dos2unix didn't remove them
cat xx > xxx  didn't remove them
strings does remove them

Thanks Gerry. I knew there had to be an easier way.

Does the flavor of linux you have offer dos2unix and unix2dos commands?

On Thu, Apr 3, 2008 at 8:17 AM, Wakefield, Thad M. <twakefield at stcloudstate.edu<mailto:twakefield at stcloudstate.edu>> wrote:
The file written by script during a router session contains
backspaces.

For example:

$cat -A xx
AC6509#sho proc cpu | e 0.0.^H ^H0^M$
AC6509#sho te h^H ^H^H ^Hch^M$

In order to share the file with Windows users, the backspaces
need to be removed. The file should be a WYSIWYG of cat:

$cat xx
AC6509#sho proc cpu | e 0.00
AC6509#sho tech

Web searches and experimenting with various command options
and pipes didn't solve the problem.

I wrote the following to remove the backspaces:

#!/bin/bash
while :
do
 if ( egrep -m1 ^H xx > /dev/null )
 then
    sed -i 's/.^H//' xx
 else
    exit
 fi
done
 sed -i 's/^M//' xx

Is there an easier solution using Linux commands?


Thad

_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
tclug-list at mn-linux.org<mailto:tclug-list at mn-linux.org>
http://mailman.mn-linux.org/mailman/listinfo/tclug-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20080403/a0021315/attachment.htm