1849031 Members
4530 Online
104041 Solutions
New Discussion

Re: Freak characters

 
SOLVED
Go to solution
Wagner_17
Advisor

Freak characters


Hi people,

We use a 2.0.3 version of Samba running over a hp-ux 10.20/k580 server. We have some directories sharing files and when this files (typically text files) are transferred to PC´s running Windows, some of then (or all)are created with freak characters at the end of lines.

Anyone can help me?

Hugs

Wagner
5 REPLIES 5
Pete Randall
Outstanding Contributor
Solution

Re: Freak characters

Probably carriage returns/line feeds. Try running the file through the ux2dos command first: ux2dos filename > newfilename


Pete

Pete
Franky_1
Respected Contributor

Re: Freak characters

Hi,

normally this problem occurs with carriage return / linefeed chars - if so you can try to remove them using the "ux2dos" command (convert to dos format)

ux2dos >

Regards

Franky
Don't worry be happy
Darren Prior
Honored Contributor

Re: Freak characters

Hi,

As mentioned above, this is caused by Windows and HP-UX treating the end of lines differently. Be very careful about running ux2dos unless you are sure of the file's contents. You should consider what will be creating the files, and what will be used to read them.

regards,

Darren.

PS: Welcome to the ITRC forums!
Calm down. It's only ones and zeros...
Bill Hassell
Honored Contributor

Re: Freak characters

These are not freak characters. They will show up in ASCII text files as ^M which is vi's way of showing a carriage return. Because Windows is a totally different operating system (just like mainframes and Macs, etc), sharing files will always require awareness of the different ways data is stored. On a Unix box (HP-UX), every ASCII file is terminated with a linefeed (LF) character but on a Windows box, ASCII files have carriage-return *AND* linefeed (CR-LF) at the end of each line, plus there is usually a ^Z (CTRL-Z) at the end of the file. As mentioned, the dos2ux and ux2dos programs will fix the files, but be aware that if you fix them on the Unix side, running Notepad on the Windows side will show a blackout character for the LF as it is expecting CR-LF. There is no automatic fix for this.


Bill Hassell, sysadmin
R. Sri Ram Kishore_1
Respected Contributor

Re: Freak characters

Hi Wagner,

Take a look at this thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=618078

Regards,
Sri Ram
"What goes up must come down. Ask any system administrator."