Operating System - HP-UX
1833541 Members
2878 Online
110061 Solutions
New Discussion

dos2unix - HP-UX equivalent command

 
SOLVED
Go to solution
Steve Evatt
Esteemed Contributor

dos2unix - HP-UX equivalent command

We are trying to discard or convert rogue characters in a script that are causing the script to bomb. The rogue characters originate from the event logs on windows systems and are then processed by the script from the OpenView database.

Is there an equivalent command in HP-UX to the solaris dos2unix comand that could perform the action of stripping these characters?

Thanks in advance
6 REPLIES 6
V. Nyga
Honored Contributor
Solution

Re: dos2unix - HP-UX equivalent command

Hi Steve,

try 'dos2ux old_name > new_name'

Volkmar
*** Say 'Thanks' with Kudos ***
Pete Randall
Outstanding Contributor

Re: dos2unix - HP-UX equivalent command

dos2ux/ux2dos would be the command.


Pete

Pete
T G Manikandan
Honored Contributor

Re: dos2unix - HP-UX equivalent command

solaris --dos2unix
hp--dos2ux
Steve Evatt
Esteemed Contributor

Re: dos2unix - HP-UX equivalent command

Thanks guys, we'll give that a go.
Bill Hassell
Honored Contributor

Re: dos2unix - HP-UX equivalent command

These aren't rogue characters but the effect in sharing files between completely unrelated operating systems. ^M is a carriage return and in Windows, all plain ASCII files have each line terminated with CR *and* LF, but in Unix, the lines are terminated with just LF. That's why vi shows ^M at the end of the lines...it's a valid character, just unexpected. Most of the time, these problems come up when sharing filesystems. The assumption is that the data will look the same but since neither Windows no Unix implement filesystembased filetypes, there is no special processing that can go on in the background. (Windows does have a type extension which is just a convenience to launch a specific program to read/write that file but the filesystem code does nothing with the data format).

ftp recognized this issue a *LONG* time ago and implemented an ASCII filter. If you use BINARY to transfer in ftp, you'll get the special codes from Windows. But if you transfer in ASCII, ftp uses a format-neutral method to send the data, relying on the target system to do the right thing for the local opsystem. This is especially helpful with mainframes where there are dozens of filetypes and unit record sizes.


Bill Hassell, sysadmin
Steve Evatt
Esteemed Contributor

Re: dos2unix - HP-UX equivalent command

Thanks all for your help