LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Remove control characters in Script output (https://www.linuxquestions.org/questions/linux-newbie-8/remove-control-characters-in-script-output-4175451789/)

Dalavich 02-26-2013 01:31 PM

Remove control characters in Script output
 
I'm using the "script" command to log my entries and activities in Linux.

All is going well, but it's capturing the control characters too, which is fine for displaying it back in the terminal.

However when I come to edit the text, these are all present and it ruins the formatting.

Is there a way to remove them for text editing? Thanks.

Example output (characters highlighted)...

Script started on Tue 26 Feb 2013 06:09:26 PM UTC
pc3:~#
pc3:~# hostname
pc3
pc3:~# ls
pc3:~# ls /hosthome/ -l
total 56
drwxr-xr-x 2 guest guest 4096 2013-01-22 11:46 Desktop
drwxr-xr-x 2 guest guest 4096 2013-01-16 16:36 Documents
pc3:~# exit
exit

danielbmartin 02-26-2013 03:34 PM

Google may provide the advice you seek.
Do a Google search on the title of this thread ...
Code:

Remove control characters in Script output
... and you will find plenty of relevant pages.

Daniel B. Martin

Dalavich 02-26-2013 04:05 PM

Thanks, I think I found the tr command - but as usual with Google there was a load of irrelevant dross, hence why I found this forum!


All times are GMT -5. The time now is 04:25 AM.