I hope this makes sense. I use 'scripts' to make copies of my ssh sessions for various reasons.
When I access the logs via less, etc, I see this:
Script started on Mon 12 Sep 2011 08:59:14 AM CDT
ESC]0;root@:~^G[root@ESC[1;31m ESC[0;0m~]#
ESC]0;root@:~^G[root@ESC[1;31m ESC[0;0m~]# logout
ESC[HESC[2JConnection to closed.^M
Script started on Mon 12 Sep 2011 09:00:32 AM CDT
Last login: Sat Sep 10 18:13:00 2011 from ^M
ESC]0;root@:~^G[root@ESC[1;31m ESC[0;0m~]#
ESC]0; 3.03, 2.32, 2.20^G
test.log (END)
When I cat it, I see this:
Perk ~ # cat test.log
Script started on Mon 12 Sep 2011 08:59:14 AM CDT
[root@ ~]#
[root@ ~]# logout
Connection to closed.
Script started on Mon 12 Sep 2011 09:00:32 AM CDT
Last login: Sat Sep 10 18:13:00 2011 from
[root@ ~]# [/code]
If I try and pipe this to a file, it returns to look like the less output.
When I edit it in vi, this is what i see:
Script started on Mon 12 Sep 2011 08:59:14 AM CDT
^M
^[]0;root@:~^G[root@^[[1;31m ^[[0;0m~]# ^M
^[]0;root@:~^G[root@^[[1;31m ^[[0;0m~]# logout^M
^[[H^[[2JConnection to closed.^M^M
Script started on Mon 12 Sep 2011 09:00:32 AM CDT
Last login: Sat Sep 10 18:13:00 2011 from ^M^M
^[]0;root@:~^G[root@^[[1;31m ^[[0;0m~]# ^M
^[]0; 3.03, 2.32, 2.20^G^M
Does anyone know how I can get this cat
output into a file for easy viewing?
cat
because your terminal emulator interprets these caracters as colors for the text.