Cygwin Interpreter

 
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI
View previous topic :: View next topic  
Author Message
ob2s
-


Joined: 04 Aug 2009
Posts: 2

PostPosted: Tue Aug 04, 2009 4:09 am    Post subject: Cygwin Interpreter Reply with quote

Is it possible to use (win32) cygwin's bash shell in cgi ? Instead of running perl.exe you run bash.exe and set .sh as scripts to be run ? It seems to work somewhat I call this foo.sh or foo.cgi the result is the same.

#!/bin/bash
PATH=/cygdrive/c/windows/system32:/usr/bin:/bin
echo "Content-Type: text/html"
echo " "
echo " "
echo OK
echo OK |sed "s/K/G/g"
echo OK > foo.txt

I get the first OK, but then this

sed: -e expression #1, char 8: unknown option to `s'
y.sh: line 7: foo.txt^M: No such file or directory

so it doesn't seem to like the bash commands. Any advice besides dumping it and doing Perl ?
Thanks
Back to top View user's profile Send private message
aprelium-support
-


Joined: 20 Feb 2009
Posts: 356

PostPosted: Tue Aug 04, 2009 5:36 pm    Post subject: Re: Cygwin Interpreter Reply with quote

ob2s,

The following error:

^M: No such file or directory

means that you are using the "CR"+"LF" end of line character (probably because you created your text file with a windows notepad).

In Linux systems, only the "LF" end of line character is supported.

To solve this issue, open your file with SciTE for example then go to :

View>End of Line (or simply click on Ctrl + Shift + 9)

Then you will see the "CR" and "LF" characters.

Remove all the "CR" characters.

It should be working now !!!
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Visit poster's website
ob2s
-


Joined: 04 Aug 2009
Posts: 2

PostPosted: Tue Aug 04, 2009 7:09 pm    Post subject: Re: Cygwin Interpreter Reply with quote

aprelium-support wrote:
ob2s,

Remove all the "CR" characters.

It should be working now !!!


Hi,
I see them using Scite (CR)(LF) but I can't seem how to remove only the CR, any tips ?
Thanks
Back to top View user's profile Send private message
aprelium-support
-


Joined: 20 Feb 2009
Posts: 356

PostPosted: Wed Aug 05, 2009 9:51 am    Post subject: Re: Cygwin Interpreter Reply with quote

ob2s wrote:
aprelium-support wrote:
ob2s,

Remove all the "CR" characters.

It should be working now !!!


Hi,
I see them using Scite (CR)(LF) but I can't seem how to remove only the CR, any tips ?
Thanks


Go to "Options" > "Line end characters"

Select "LF" (by default "CR+LF" is selected)

Go to options again and click on "Convert Line end characters"

Save your file !!

Is it ok ?
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Visit poster's website
Stegliree
-


Joined: 11 Jul 2011
Posts: 5
Location: Canada

PostPosted: Sun Dec 18, 2011 8:37 am    Post subject: Cygwin Interpreter Reply with quote

I dont know if you can use cygwin, but do yourself a favour, set up your PC
to dual boot Linux
Back to top View user's profile Send private message Send e-mail ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI All times are GMT + 1 Hour
Page 1 of 1

 
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


Powered by phpBB phpBB Group