4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 squashed up scripts
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
domuk
WebHelper
WebHelper


Joined: 15 Jan 2004
Posts: 91

PostPosted: Sat Jan 31, 2004 7:07 pm (20 years, 2 months ago) Reply with QuoteBack to Top

Hi it's me again,

Could someone please tell me why when I download scripts from perl scripting sites they come all “squashed up” with squares where there should be carriage returns. This makes it very difficult to read.

I think it is something to do with notepad and the file saving / viewing.

I appear to be able to get cgi and perl scripts working when I can cut and paste from an online text file and thus keep the correct “un squashed format”.

1) If I use them in the squashed format (with squares) will they work?

2) If I cut and paste into WordPad it appears to un squash them. Should I be using WordPad for cgi scripts?

3) Why does this happen?

4) Is it something to do with my FTP software (smartFTP)?

5) Could this explain why I cannot get any downloaded perl scripts working and I keep getting “internal server error 500”?

6) If I manually remove the squares and resave them in notepad (yes I have tried that in desperation) will this not work?

7) what format should I be saving / downloading / viewing *.pl and *.cgi scripts in?

Your help is always appreciated for this novice…


Thanks,

Dom.
OfflineView User's ProfileFind all posts by domukSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sat Jan 31, 2004 7:51 pm (20 years, 2 months ago) Reply with QuoteBack to Top

The problem is simple: Notepad does not support Unix line breaks. You'll have to choose another text editor - I personally use Context from fixedsys.com, however there are a lot of other ones out there.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Sat Jan 31, 2004 9:09 pm (20 years, 2 months ago) Reply with QuoteBack to Top

if you want a simple one that comes with windows, wordpad will read them correctly

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
domuk
WebHelper
WebHelper


Joined: 15 Jan 2004
Posts: 91

PostPosted: Sat Jan 31, 2004 11:00 pm (20 years, 2 months ago) Reply with QuoteBack to Top

Thanks,

Can you please explain why this is the case?
What format do i have to save them in?
Why will notepad not do it?
Is the same for HTML?
Sorry, i just want to know,

Dom...
OfflineView User's ProfileFind all posts by domukSend Personal Message
domuk
WebHelper
WebHelper


Joined: 15 Jan 2004
Posts: 91

PostPosted: Sat Jan 31, 2004 11:06 pm (20 years, 2 months ago) Reply with QuoteBack to Top

will scripts still work in this format?
OfflineView User's ProfileFind all posts by domukSend Personal Message
SfCommand
Senior WebHelper
Senior WebHelper


Joined: 10 Nov 2002
Posts: 143
Location: UK

PostPosted: Sat Jan 31, 2004 11:41 pm (20 years, 2 months ago) Reply with QuoteBack to Top

I use UltraEdit (www.ultraedit.com)
If you use notepad to create your files, then you may run into troubles as it, to be honest, is a load of ****, and ins only capable of adding windows end of line chars.
Some scripts on *nix servers may choke if they have windows EOF chars instead of *nix ones.
If you get a decent editor, then you can save files in UNIX format, which will use unix EOF chars, which will be fine

________________________________
Miguel

http://community.34sp.com
http://www.miguel.me.uk | http://www.sfcommand.co.uk | http://www.ssdg.org.uk
OfflineView User's ProfileFind all posts by SfCommandSend Personal MessageVisit Poster's Website
domuk
WebHelper
WebHelper


Joined: 15 Jan 2004
Posts: 91

PostPosted: Sun Feb 01, 2004 8:42 am (20 years, 2 months ago) Reply with QuoteBack to Top

thanks Miguel
OfflineView User's ProfileFind all posts by domukSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sun Feb 01, 2004 8:46 am (20 years, 2 months ago) Reply with QuoteBack to Top

SfCommand wrote:
I use UltraEdit (www.ultraedit.com)
If you use notepad to create your files, then you may run into troubles as it, to be honest, is a load of ****, and ins only capable of adding windows end of line chars.
Some scripts on *nix servers may choke if they have windows EOF chars instead of *nix ones.
If you get a decent editor, then you can save files in UNIX format, which will use unix EOF chars, which will be fine


Basically, PHP and HTML files are OK with Windows line breaks. However Perl scripts will not work if you use Windows line breaks with them.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Sun Feb 01, 2004 1:39 pm (20 years, 2 months ago) Reply with QuoteBack to Top

for those with shell access, you can use the utilities dos2unix and unix2dos to convert files to and from unix format

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
SfCommand
Senior WebHelper
Senior WebHelper


Joined: 10 Nov 2002
Posts: 143
Location: UK

PostPosted: Mon Feb 02, 2004 7:24 pm (20 years, 2 months ago) Reply with QuoteBack to Top

If using UltraEdit, you can also convert from unix to dos and vice versa Smile

________________________________
Miguel

http://community.34sp.com
http://www.miguel.me.uk | http://www.sfcommand.co.uk | http://www.ssdg.org.uk
OfflineView User's ProfileFind all posts by SfCommandSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.124177 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme