![]() |
how can you tell dos newlines from linux newlines?
How can I tell if a file has DOS newlines or Linux newlines?
|
I'm sure of dos but windows is \r and unix is \n
|
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.
|
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. |
Quote:
|
Quote:
|
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). |
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. |
Quote:
|
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???
|
| All times are GMT -7. The time now is 04:39 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123