Does the following do what you need:

# cat xx > clean.txt

All those special things should be removed.

Eric Crist


On Apr 3, 2008, at 8:17 AM, Wakefield, Thad M. 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
> http://mailman.mn-linux.org/mailman/listinfo/tclug-list

-----
Eric F Crist
Secure Computing Networks