lorian | 18 Jul 2004 16:08
Picon
Favicon

Re: Linux vs win32 emacs


  > > I'm having great trouble moving scripts over from windows
  > > to Linux.

You should give an example here. What kind of 'scripts' are you
referring to?

  > > OK with command differences, but its something to do with line
  > > endings?

It may, but need not be a problem.

  > > Any way I can 'see' line endings /convert them or something
  > > in Linux please?  At least to see where the problem is!

Sound like you are migrating to Linux. A rock-solid way to actually
see line endings is use hexl-mode: A mere newline is 0a, a CRLF is
0d0a.

But as I said, it NEED not be a problem. Emacs, for one, handles
different line endings (as long as they are consistent in a given
file), and will simply display "(DOS)" in the modeline when you look
at a DOS file. I guess it simply depends on the application whether it
can handle alien line ends (also true conversely: Notepad will diplay
Unix files all in one line, with odd squares where the line breaks
ought to be, while Windows/DOS 'more' will display the lines
correctly).

  > However, I typically do this with a command-line Perl script when I
  > need to convert from Macintosh linends to Unix linends:
  >   perl -pe's/\r/\n/g;' in-with-Mac-eols > out-with-Unix-eols
  > Can't be too difficult to figure out the Windows equivalent.
  > (s/\r\n/\n/g; or maybe s/\r\f/\n/g;?)

The former. But this approach is only transparent if such a command
line script is run under *nix. Run with PerlWin32, this script will
mysteriously produce the same CRLF in the output, either because it
converts CRLF to \n when reading the file or because it converts \n to
CRLF when writing. Or both. You'd have to use binmode(FILEHANDLE) to
switch this behaviour off.

--

-- 
                                               Florian von Savigny
__________________________________________________________________
sawitzky2000 <at> yahoo.de

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click

Gmane