|
|
|
||||
|
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
Confirmed User
Join Date: Jan 2001
Posts: 3,539
|
how can you tell dos newlines from linux newlines?
How can I tell if a file has DOS newlines or Linux newlines?
|
|
|
|
|
|
#2 |
|
Confirmed User
Join Date: Oct 2002
Location: European Union
Posts: 1,752
|
I'm sure of dos but windows is \r and unix is \n
|
|
|
|
|
|
#3 |
|
Confirmed User
Join Date: Jan 2001
Posts: 3,539
|
What do you mean? I have a bunch of cgi files and I want to know if they have DOS newlines or Linux newlines in them. I tried "cat filename.cgi" and it does not seem to show a difference from one to the other. I may be mistaken as I can not tell what file is what.
|
|
|
|
|
|
#4 |
|
Confirmed User
Join Date: Oct 2002
Location: European Union
Posts: 1,752
|
Try to open the files in windows notepad or wordpad.
If it looks fine it's windows newline \r If there is a square box in the end every line it's unix newline \n. Windows can't handle unix newlines and fuckup and show a square instead. Some default ascii char. I'm not sure if it helps. |
|
|
|
|
|
#5 | |
|
Confirmed User
Join Date: Dec 2001
Location: Malibu
Posts: 3,817
|
Quote:
|
|
|
|
|
|
|
#6 | |
|
Confirmed User
Join Date: Jan 2001
Posts: 3,539
|
Quote:
|
|
|
|
|
|
|
#7 |
|
Confirmed User
Join Date: Apr 2002
Location: Virgin - nee
Posts: 3,162
|
If your script isn't working and it says to make sure there are no newlines in it, check the comments and make sure that nothing's wrapped while you were editing it in pico.
#A comment should look like this #A comment should not take up two lines like this Make sure you uploaded it in ASCII format. Make sure it's chmoded to 755. Make sure the shebang line has the correct path to perl for your server (if you don't know what it is, do a "whereis perl" while you're in a shell). |
|
|
|
|
|
#8 |
|
Confirmed User
Join Date: Jan 2001
Posts: 3,539
|
My CuteFTP Pro is set for ASCII uploads on *.cgi files by default and it did not do this for some reason. I am still working on the problem.
Using Webmin's File Manager I can save the files to my Windows computer and view them in Notepad (but not Wordpad) to see if the files are Linux or DOS newlines. Linux newlines do not work in Notepad. Thanks for all your help. |
|
|
|
|
|
#9 | |
|
Confirmed User
Join Date: Jan 2001
Posts: 3,539
|
Quote:
|
|
|
|
|
|
|
#10 |
|
Confirmed User
Join Date: Jan 2001
Posts: 3,539
|
Is is *ever* possible for a cgi script to run with DOS newlines in it? I have proof that a few of my scripts actually ran like this, but it makes no sense to me at all. Perhaps if a cronjob runs the script it works on DOS newline scripts???
|
|
|
|