[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: How do I convert a DOS file to a UNIX file?



Hello Scott,
If the majority of the files you need to migrate will 
be edited with vi, you can use vi to accomplish the 
dos-to-unix translation (ot the reverse).  Just set 
the file format and save the file.  For example,

:set ff=unix [enter]   or
:set ff=dos [enter]

followed by a ZZ to write and exit, and you are all set.

Another thought:  if FTP is responsible for the original 
translation, you may be able to avoid this by specifying 
BIN mode for the transfers (just use the BIN command in 
ftp).  Copying to a server, or burning CDs should not 
tamper with the internal structure of files, so FTP 
is the most likely culprit.  you can find out by looking 
at the file length in each environment:  the DOS version 
will be longer (2 chars per newline instead of 1) than 
the matching unix version.

A Becker


Fred Dech <fdech uchicago edu> wrote:
> On Thu, Jun 27, 2002 at 11:45:21AM -0700, Keith Morse wrote:
> > 
> > On Thu, 27 Jun 2002, Scott Lockhart wrote:
> > 
> > > Folks,
> > > Due to strict DMZ requirements at a particular client,
> > > I am not allowed to ftp UNIX files from one Linux server
directly to
> > > another.
> > > Instead, I have to ftp to a general staging area, copy to a
Windows 2000
> > > server,
> > > burn a CD-ROM, then mount the CD-ROM on my DMZ'd Linux Server.
> > > Major pain in the a**!
> > 
> > If there is any type of network connectivity from the original
linux host 
> > to the destination, such as ssh, there may be a way to "tunnel" an
scp 
> > stream.  This will work even if you have to access the "DMZ" from
an 
> > access host.  I suspec the unix-dos conversion is being done by
ftp.
> > 
> > 
> > > When I go to edit the file on my destination Linux server,
> > > it is now recognized by "vi" as a DOS file!
> > > I suspect this is being done by the CD-ROM burner as far as
setting a
> > > file format.
> > > I have tried specifying an ISO 9660 format for the CD-ROM,
> > > but all this does is mess up the file names to the old 8.3
format,
> > > and the files themselves still get whacked into a DOS filetype.
> > > 
> > > How can I convert a file designated as a DOS type, to a UNIX
type?
> > 
> > 
> > Another tool to take a look at is cygwin.  In your case, it would
need to 
> > be installed on the W2K host.  It'll provide you with a shell
environment 
> > that you get with a linux host.  In that environment you could
build an 
> > iso that would preserve the file name structure found on the
original 
> > host.
> > 
> > 
> > 
> there is/was a SYSV command, to_unix, that has evolved to
> dos2unix in linux.
> 
> --fred
> 
> 
> 
> _______________________________________________
> Redhat-list mailing list
> Redhat-list redhat com
> https://listman.redhat.com/mailman/listinfo/redhat-list





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]