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 attachment file it contains everything I need but also some :

[]

It's not this, but closely, as I cannot post it in the theard I have done my best

and I do not know where there come from and how I can get rid of them. I am wondering if there were generated by "uuencode".

This can be visble only when I open the txt file with notepad and not with wordpad or notepad++ !

I hope someone will be able to understand me ....

Thanks for your help

use dos2unix file to format .txt file and then gzip/mail the same.

Hi,

I used this while formating the file :

sed 's/^M$//'

but the dos2unix did not work .....

Hello,

I mean use "dos2unix" command.

dos2unix

Using the above did not solve your problems?

Hi,

Sorry, I did not explain correctly :

I first try to remove what seems to be carriage return with this :

sed 's/^M$//'

I used it like this :

cat file_name | cut -d " " -f7- | nawk '{if(NR%2==1)print $0}' | sed 's/^M$//' > ${fic_rpt}

and the I used gzip and uuencode to send it by mail

is the way I should try ?

Hello,

from where the "file_name" is from. Is it a unix/windows file?

if it's from windows, apply

dos2unix on file_name and pipe the outcome on to your command.

If not, might be some issue with uuencode.

Hi,

I almost solved the issue. It's sure now it's carriage return ...

I am generating the file on UNIX and it cannot be displyed correctly on Windows.

I did use

tr -d "\n" > ${fic_rpt}

I get rid of the carriage return but all lines become in one line on Windows.

Then I try to use instead

unix2dos > ${fic_rpt}

and the display on windows is perfect ... But I'am getting warning message at the end of my shell script :

could not open /dev/kbd to get keyboard type US keyboard assumed
could not get keyboard type US keyboard assumed

Thanks for your help ....

---------- Post updated at 04:28 PM ---------- Previous update was at 03:57 PM ----------

..... PROBLEM SOLVED

Here is the solution while using "unix2dos" and get rid of the warning message :

unix2dos -437 ${fic_rpt_tmp} > ${fic_rpt}

Thanks all for your help.

I do not know if I can but here is the web page where I get the info :

UNIX Warning Message: could not open /dev/kbd � Phil for Humanity