| View previous topic :: View next topic   | 
	
	
	
		| Author | 
		Message | 
	
	
		ob2s -
 
  Joined: 04 Aug 2009 Posts: 2
 
  | 
		
			
				 Posted: Tue Aug 04, 2009 4:09 am    Post subject: Cygwin Interpreter | 
				      | 
			 
			
				
  | 
			 
			
				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 | 
		
			          | 
		
	
	
		  | 
	
	
		aprelium-support -
 
  Joined: 20 Feb 2009 Posts: 356
 
  | 
		
			
				 Posted: Tue Aug 04, 2009 5:36 pm    Post subject: Re: Cygwin Interpreter | 
				      | 
			 
			
				
  | 
			 
			
				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 | 
		
			           | 
		
	
	
		  | 
	
	
		ob2s -
 
  Joined: 04 Aug 2009 Posts: 2
 
  | 
		
			
				 Posted: Tue Aug 04, 2009 7:09 pm    Post subject: Re: Cygwin Interpreter | 
				      | 
			 
			
				
  | 
			 
			
				 	  | 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 | 
		
			          | 
		
	
	
		  | 
	
	
		aprelium-support -
 
  Joined: 20 Feb 2009 Posts: 356
 
  | 
		
			
				 Posted: Wed Aug 05, 2009 9:51 am    Post subject: Re: Cygwin Interpreter | 
				      | 
			 
			
				
  | 
			 
			
				 	  | 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 | 
		
			           | 
		
	
	
		  | 
	
	
		Stegliree -
 
  Joined: 11 Jul 2011 Posts: 5 Location: Canada
  | 
		
			
				 Posted: Sun Dec 18, 2011 8:37 am    Post subject: Cygwin Interpreter | 
				      | 
			 
			
				
  | 
			 
			
				I dont know if you can use cygwin, but do yourself a favour, set up your PC
 
to dual boot Linux | 
			 
		  | 
	
	
		| Back to top | 
		
			            | 
		
	
	
		  | 
	
	
		 |