Junk characters in file not in Solaris, but visible in linux

Hello All,
I have a DOS file which I run a DOS 2 UNIX utility on. When run from Solaris, I can view the file perfectly. But, when run from linux, I see a bunch of junk(^@) at the beginning of every line in the file. Does anyone know the cause of this?

COMMAND TO CONVERT:
tr -d '\015\032' <"$IN" >"$OUT"

FILE EXAMPLE:
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@Ths is what it looks like when i open file with vi
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^each line has this junk in it

Dos 2 Unix, and related programs, normally only deal with <CR> carriage return and <LF> line feed issues.

In your message, you included a tr command. Did you also run this? What did the file look like prior to doing conversion(s)?

used dos2unix before transfered?

I used 'cat -tv' on the file before converting from dos to unix format in Solaris. And I can see the junk(^@) characters. But, the junk characters disappear in Solaris after running 'tr' on the file. The junk characters do not disappear in RHEL after i run 'tr' on them. I am only using 'tr' to convert my files.

-V

you can do this when you vi the file as follows:
:%s/^@//g
can you try this and see?

The problem is that we have an automated process which processes these files. So, i need to find out why we can process successfully in Solaris, but not in RHEL. There are several ways to get rid of this data. But, what is diff between 'tr' in Solaris and RHEL?

-David

You should be able to see it in Solaris's vi as well, but you need to:

:set list

To turn it off:

:set nolist

hhmmm.. :o
The Solaris tr MAN pages examples exclusively use quotes around the tr arguments.
But in Linux,
tr -cd '\11\12\40-\176' < myfile1 > myfile2

  • this example would take the file myfile1 and strip all non printable characters and take that results to myfile2.
    Can you see the difference? :frowning: