1748185 Members
4196 Online
108759 Solutions
New Discussion юеВ

dos2ux using sed

 
SOLVED
Go to solution
Christian Deutsch_1
Esteemed Contributor

dos2ux using sed

Hi there,

I want to use dos2ux functionality on both HP-UX and Solaris. Since I didn't find dos2ux on Solaris I thought of this:

sed s/$/\`/ < oldwinfile | tr '`' '\015' > newwinfile

A colleague expressed concern that oldwinfile might contain a backtick (`) character, then this would not work.

Any ideas?

The first three useful responses will be rewarded with points!

Remember that the solution must work on BOTH HP-UX and Solaris.

Thanks, Christian
Yeshua loves you!
5 REPLIES 5
Robert-Jan Goossens
Honored Contributor
Solution

Re: dos2ux using sed

Hi Cristian,

Try dos2unix on solaris (solaris 8 on my workstations has got it)

Regards,
Robert-Jan
Nicolas Dumeige
Esteemed Contributor

Re: dos2ux using sed

Hello,

On Solaris 5.8 :
# type dos2unix
dos2unix is a tracked alias for /bin/dos2unix

Cheers

Nicolas
All different, all Unix
Nicolas Dumeige
Esteemed Contributor

Re: dos2ux using sed

If you don't find it, there's a lot a C source on the web, like this one :

http://www.grubinski.com/grubinski/dos2unix.c

If you just want to get rid of the line feed :
sed -e 's/^M//g' filename
(^M is done with CTRL+M)

All different, all Unix
Christian Deutsch_1
Esteemed Contributor

Re: dos2ux using sed

I'm done.

Thanks folks.

Sorry I type the title wrong, should have been ux2dos, not dos2ux.

I won't promise any points for further replies (sorry).
Yeshua loves you!
Bharat Katkar
Honored Contributor

Re: dos2ux using sed

On HP it is ux2dos:

#ux2dos file1 > file2

You need to know a lot to actually know how little you know