log file problem


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting log file problem
# 1  
Old 04-11-2011
log file problem

Hi,

I have a problem with my logfile. I am redirecting my output to log file and when iam viewing as text doc it is looking with some nonsense characters...please do help me on this .thank you.

here is my logfile which it is showing different behaviour:
Code:
spawn [open ...] 
spawn minicom 

Welcome to minicom 2.4 
 
OPTIONS: I18n  
Compiled on Jun  3 2010, 13:46:31. 
Port /dev/ttyS0 
 
Press CTRL-A Z for help on special keys 
 
   
ETH-T1> add/user=name,password 
 
Cant accept reserved characters in your command 
 
 
[23;80H [24;1H 
[23;80H [24;1HETH-T1> 
[23;80H [24;1H 
[23;80H [24;1HETH-T1>add\user=name,password 
[23;80H [24;1H 
[23;80H [24;1HCant accept reserved characters in your command 
[23;80H [24;1H 
[23;80H [24;1H 
[23;80H [24;1H 
[23;80H [24;1HETH-T1> 
[23;80H [24;1H 
[23;80H [24;1HETH-T1>DELETE/USER=name,password 
[23;80H [24;1H 
[23;80H [24;1HUnknown OAM Command:"DELETE/USER=name,password" 
[23;80H [24;1H 
[23;80H [24;1H 
[23;80H [24;1H 
[23;80H [24;1HETH-T1>add?user=name,password 
[23;80H [24;1H 
[23;80H [24;1HUnknown OAM Command:"add?user=name,password" 
[23;80H [24;1H 
[23;80H [24;1H 
[23;80H [24;1H 
[23;80H [24;1HETH-T1>delete user=name,password 
[23;80H [24;1H 
[23;80H [24;1HCant accept reserved characters in your command

Why those left characters are seeing in this file and how can view it neatly.please any one suggest me wht to do.

thank you

Last edited by Scott; 04-11-2011 at 08:07 AM.. Reason: Code tags
# 2  
Old 04-11-2011
Hi vanid,

I understand you want to remove the set of characters [23;80H [24;1H at the beginning of some lines.

If so, try with:

Code:
# Removing only set of characters, without affect resulting blank lines 
sed 's/^\[23\;80H \[24\;1H//' inputfile

Or
Code:
# Removing set of characters, setting up double spacing in the output
sed -e 's/^\[23\;80H \[24\;1H//;/^$/d;G' inputfile

Hope it helps.

Regards.
# 3  
Old 04-11-2011
log file problem

I tried it but when writing for expect we need to provide "exec" cmd before this sed command right? if do so its not working here what iam doing:
Code:
exec sed {-e s/^\[23\;80H \[24\;1H//} /home/files/logfile.txt


Last edited by Scott; 04-11-2011 at 08:07 AM.. Reason: Code tags
# 4  
Old 04-11-2011
Try as is given by cgkmal in post# 2, except replace the inputfile with your orginal file name.
# 5  
Old 04-11-2011
log file problem

Thanks to both of you. actually
here what i tried is :
Code:
sed -e 's/^\[23\;80H \[24\;1H//;/^$/d;G' /home/file.log

reponse:
Code:
invalid command name "sed"
    while executing
"sed -e 's/^\[23\;80H \[24\;1H//"
    (file "READ.exp" line 3)


Last edited by Scott; 04-11-2011 at 08:18 AM.. Reason: Code tags, please...
# 6  
Old 04-11-2011
@scottn, think you're fighting a losing battle there...Smilie
@vanid, if you don't have sed, you probably don't have awk, but:

Code:
awk -F"1H" '!/\[23/{print $0};/\[23/{print $2}' /home/file.log

# 7  
Old 04-18-2011
log file problem

Thank you so much for the answer. Actually all i have tried but i dont fine any solution iam not able to remove those characters. I am using expect language and if any other options please let me know and it is really appreciable.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem - create log file

I need to create shell script (check system ) to display the output to the console and write these output to a log file at the same time. My shell script is like that Main() { .... .... } MainIt takes about 30s to display all the output to the console. Then I put this command to the... (4 Replies)
Discussion started by: bobochacha29
4 Replies

2. Solaris

Problem with log file script

Hi, I have a log file that i'd like to monitor for a string. Now the log file rolls over everytime the server is restarted, so i'm doing a reverse list and then reading the latest log file. So for the code, the log file is 'test1.txt'. I check for the string and pipe to black hole (>... (2 Replies)
Discussion started by: horhif
2 Replies

3. Shell Programming and Scripting

Problem - Log File

Hi, I am in trouble ... again :wall: I formating a log file as .txt from Unix (solaris 9) and then I compress it with gzip and I use uuencode and send it in an email. gzip -c ${fic_report} | uuencode Report_File.gz > ${attachment_file} my problem is when I received the mail with the... (6 Replies)
Discussion started by: Aswex
6 Replies

4. Shell Programming and Scripting

Problem with Log File

Hi, I have written a bash shell script. In order to create a log file when I run the script, as well as print the output to the terminal, I call it in the following manner: my_shell_script 2>&1 | tee my_log_fileThis seems to work well. However, I have put some statements in the script to... (2 Replies)
Discussion started by: msb65
2 Replies

5. Shell Programming and Scripting

Capture all error message in Log file and send the Log file by email

Hi I have a requirement to write a script to capture all errors in a Logfile and send the file in email. If there is any error occurred the subject of email will be ERROR , If there are no error occurred the subject of email will be SUCCESS. So I created a Log file and put the Appropriate... (2 Replies)
Discussion started by: dgmm
2 Replies

6. Shell Programming and Scripting

Delete log file entries based on the Date/Timestamp within log file

If a log file is in the following format 28-Jul-10 ::: Log message 28-Jul-10 ::: Log message 29-Jul-10 ::: Log message 30-Jul-10 ::: Log message 31-Jul-10 ::: Log message 31-Jul-10 ::: Log message 1-Aug-10 ::: Log message 1-Aug-10 ::: Log message 2-Aug-10 ::: Log message 2-Aug-10 :::... (3 Replies)
Discussion started by: vikram3.r
3 Replies

7. Shell Programming and Scripting

Problem in redirecting ftp msgs to a log file

Hi all.. The following set of statements is used in a shell script to ftp a file to a remote machine I want to redirect the ftp messages thrown by the first ftp statement to a log file. As you can see there is a logic downstream to decide if the ftp was a success or not. But i am not... (5 Replies)
Discussion started by: hareeshkumaru
5 Replies

8. Solaris

problem with not able to log in

Dear all I am facing a problem that I cannot able to login through 192.168.11.6. I even unplumb it and then plumb it again also, but still facing a problem. Could anyone tell me that what is the meaning of "inet 192.168.11.6 --> 192.168.11.6". I even restart the server two time also ,but still... (7 Replies)
Discussion started by: girish.batra
7 Replies

9. Shell Programming and Scripting

Log file problem

I want to transfer files from ABC server to XYZ server in which i am successful. I would like to create a log file also by the name of current date. For some reason my script gives me an error on my scp -p command and it says LOCAL_LOG_FILE: not found and REMOTE_LOG_FILE not found. Any clues whats... (9 Replies)
Discussion started by: chris1234
9 Replies

10. UNIX for Dummies Questions & Answers

Log in Problem

Hello: I'm having the following problem when I try to log in to our Tru64 system, from any machine using root or any other user. After entering the passowrd I get the following message: and not being directed to the shell console. I think it has something to do with the audit process... (2 Replies)
Discussion started by: aladdin
2 Replies
Login or Register to Ask a Question