[texhax] atchange

Reinhard Kotucha reinhard.kotucha at web.de
Thu Mar 23 21:38:30 CET 2006

>>>>> "Novak" == Novak Elliott <N.S.J.Elliott at warwick.ac.uk> writes:

  > Hi all, my problem wasn't any of what came up on the discussion -
  > it turned out to be just the format of the text file I was
  > executing.  I downloaded the script on a PC then copied to my mac,
  > chmod'd it and... bad interpretter error message.  It couldn't
  > even get past the first line.  I created a new script using trusty
  > VI and it worked without a problem.  So my solution was to VI a
  > new file, open the original script in notepad (or whatever its
  > called) and drag the text to the terminal.  Then i deleted all of
  > the extra blank lines and also the tabs.  It works a treat.  I
  > can't remember the VI search and replace syntax for ^M's etc or
  > the sed syntax either but I got it working regardless.

Some compression tools like gzip and zip can convert linebreaks during
de-compression.  GNU recode might be helpful as well.

In Emacs you can use replace-regexp.  To insert a control character,
precede it by ^q (^ means: press the control key).

Unix to DOS: replace-regexp  $  ^q^m
Unix to Mac: replace-regexp  ^q^j  ^q^m

Using Perl:

Unix to DOS:  perl -pe "s/\xA/\xD\xA/g" < infile > outfile
Unix to Mac:  perl -pe "s/\xA/\xD/g" < infile > outfile

Control characters are written as "\x<hexnumber>" here. 

BTW, to visualize linebreaks, you can use cat -e.


Reinhard Kotucha			              Phone: +49-511-4592165
Marschnerstr. 25
D-30167 Hannover	                      mailto:reinhard.kotucha at web.de
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.

More information about the texhax mailing list