Wat Macs betreft ben jij anders ook een n00bquote:Op donderdag 22 september 2005 16:23 schreef Vampier het volgende:
damn n00b
http://www.macosxhints.com/article.php?story=20001206164827794quote:If you're having trouble getting something to work right, and that something is based on a text file (for example, a Perl CGI script or a page of HTML), make sure you don't have any hidden Mac line breaks (also called line endings) in the file!
If you installed or modified the file using a GUI-based tool, there's a chance you accidentally inserted Mac line breaks. I know (from personal experience!) that Mac line breaks can make both Perl scripts and static HTML pages non-functional if they show up in the wrong spot. Read the rest to see how to find and remove the line breaks...
How can you tell? Start a terminal and open the file with the vi text editor. It's important to use vi, as the other editors will hide control keys from sight.
If you see a bunch of ^M's in the file, you have Mac line breaks. There are some shell commands [editor's note - see the comments for a one-line perl command to fix your files!] that can auto-replace them, but I just used a Mac text editor (either jedit, BBedit, or Alpha) and re-saved the file, making sure to specify UNIX as the file type.
This problem can be very difficult to diagnose, especially if you normally edit in Emacs, and try just cat'ing the file at the command line. In both cases, you will not see the ^M's, and won't understand why your file isn't doing what it should!
|
Forum Opties | |
---|---|
Forumhop: | |
Hop naar: |