Go Back   The UNIX and Linux Forums > Operating Systems > Linux
google site



Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

Reply
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-08-2010
Registered User
 

Join Date: Mar 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED]Terminal logging character problem -Newbie-

Im a complete newbie tryin to work with linux centos;
in terminal wanted to log with script command;
but output file has some strange characters when I try to open with gedit or bluefish
terminal , gedit, bluefish encoding is utf-8 ;


Code:
Script started on Mon 08 Mar 2010 03:32:39 PM EET
]0;anacondauser@localhost:~[anacondauser@localhost ~]$ ls -al

[00mtotal 900
drwx------ 35 anacondauser anacondauser   4096 Mar  8 15:32 [00;34m.[00m
drwxr-xr-x  3 root         root           4096 Jun  6  2009 [00;34m..[00m
-rw-rw-r--  1 anacondauser anacondauser      0 Mar  8 15:32 [00mabc.txt[00m
drwx------  3 anacondauser anacondauser   4096 Jun  6  2009 [00;34m.adobe[00m
-rw-------  1 anacondauser anacondauser   5814 Mar  8 15:24 [00m.bash_history[00m
-rw-r--r--  1 anacondauser anacondauser     33 May 25  2008 [00m.bash_logout[00m

[m]0;anacondauser@localhost:~[anacondauser@localhost ~]$ exit

Script done on Mon 08 Mar 2010 03:32:44 PM EET
also vim output has weird characters

drwx------ 35 anacondauser anacondauser 4096 Mar 8 15:32 ^[[00;34m.^[[00m^M
drwxr-xr-x 3 root root 4096 Jun 6 2009 ^[[00;34m..^[[00m^M
-rw-rw-r-- 1 anacondauser anacondauser 0 Mar 8 15:32 ^[[00mabc.txt^[[00m^M
drwx------ 3 anacondauser anacondauser 4096 Jun 6 2009 ^[[00;34m.adobe^[[00m^M
-rw------- 1 anacondauser anacondauser 5814 Mar 8 15:24 ^[[00m.bash_history^[[00m^M
-rw-r--r-- 1 anacondauser anacondauser 33 May 25 2008 ^[[00m.bash_logout^[[00m^M

dos2unix outputs only txt file (from abc.log to abc.txt);

those weird color characters remains the same :(


I was hitting  keys to remap ^[[00m; ^M etc by
ctrlv+key combinations and I mistakenly hit enter or did sth
and my F5 key is not working right now;

stty -a
speed 38400 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?;
swtch = M-^?; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc ixany imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke

[anacondauser@centaur ~]$ stty
speed 38400 baud; line = 0;
eol = M-^?; eol2 = M-^?; swtch = M-^?;
ixany iutf8

issue remains the same
how can I get rid of those weird color characters when I log with script command ?
or how could I log my terminal output without those weird characters(btw xterm doesn allow me log to file)?

Last edited by scottn; 03-08-2010 at 03:50 PM.. Reason: Removed some formatting, added code tags......
Sponsored Links
  #2  
Old 03-08-2010
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 6,729
Thanks: 0
Thanked 53 Times in 50 Posts
Here is a discussion of terminal colors (those goofy characters) and how to deal with them:

So You Like Color--The Mysterious ^[[ Characters | Linux Journal
  #3  
Old 03-08-2010
Registered User
 

Join Date: Mar 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
FYI...
@TERMINAL CONSOLE> SHELL=/bin/sh PS1="$" script abc.log --->worked like a charm
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Gentoo: Ruby Terminal Control Character Injection Linux Bot Security Advisories (RSS) 0 01-14-2010 01:00 PM
newbie looking for Terminal tutorials mightypants OS X (Apple) 1 04-26-2009 01:14 PM
problem in logging into root mnmca HP-UX 6 02-05-2009 01:10 PM
sending a null character to a terminal vertigo23 UNIX for Advanced & Expert Users 3 09-30-2005 09:58 PM
Run the start script from the terminal? Newbie Time! waking_bear UNIX for Dummies Questions & Answers 4 03-04-2004 06:09 PM



All times are GMT -4. The time now is 07:48 AM.