| Author |
Message |
shemo
Joined: 26 Apr 2002 Posts: 28
|
05 Jun 2002 23:51 Is there a unix equivalent dos2unix utility in linux? |
|
|
|
I couldn't find it. pls advise.
thanks
|
|
| Back to top |
|
 |
cdic
Joined: 28 Jun 2001 Posts: 151 Helped: 2 Location: silly valley
|
06 Jun 2002 1:26 |
|
|
|
just remove all "^M" from your files using vi or sed or other editors. no need using dos2unix, you can write a simple script to implement this. and name dos2linux.
|
|
| Back to top |
|
 |
CatKing
Joined: 05 Jun 2001 Posts: 277 Helped: 1
|
06 Jun 2002 3:21 |
|
|
|
Hi, There:
http://ibiblio.org/pub/Linux/utils/text/dos2unix-3.0.tar.gz
|
|
| Back to top |
|
 |
jimjim2k
Joined: 17 May 2001 Posts: 1243 Helped: 10
|
06 Jun 2002 8:27 |
|
|
|
Hi
Try this perl script
#!/usr/bin/perl
# convert a dos \r\n format to unix \bn
open (FILE, $ARGV[0]);
while (<FILE>) {
# remove the stupid \r, replace with \n
# some broken editors just put \r
s/\r/\n/g;
# Remove the duplicate \n
s/\n\n/\n/g;
print;
}
tnx
|
|
| Back to top |
|
 |
jimjim2k
Joined: 17 May 2001 Posts: 1243 Helped: 10
|
06 Jun 2002 8:35 |
|
|
|
Hi
BTW:
Look at the following perl link for additional free perl scripts.
It is searchable too.
1. h**p://www.perlmonks.org
* -> t
tnx
|
|
| Back to top |
|
 |
tdo48
Joined: 13 Jan 2002 Posts: 21
|
06 Jun 2002 17:27 |
|
|
|
| Or you meant the reverse operation: unix2dos.....
|
|
| Back to top |
|
 |