Fwd: LiveCodeServer - Prints shebang line

Peter W A Wood peterwawood at gmail.com
Tue Jul 15 21:42:35 EDT 2014


Somebody asked a question on the mailing list related to running LiveCode CGI scripts using LiveCode Server - Livecode CGIs co-existing with old-school Rev 2.x CGIs (Basically, he's trying to avoid changing the Apache configuration file).

I don't see any reason that you can't use LiveCode Server to run CGI scripts so I thought that I'd experiment.

First I ran a simple script from the command line:

	<?lc
   		set the outputLineEndings to "lf"
   		put "content-type: text/plain" & return & return
   		put "Hello from a LiveCodeServer CGI script" & return
	?> 

	$LiveCodeServer/livecode-server cgi-bin/livecode.cgi
	content-type: text/plain
	
	Hello from a LiveCodeServer CGI script

Next,  I added the shebang line and ran it again:

	#!/Users/peter/Sites/LiveCodeServer/livecode-server 
	<?lc 
		set the outputLineEndings to "lf" 
		put "content-type: text/plain" & return & return 
		put "Hello from a LiveCodeServer CGI script" & return 
	?> 

	$ cgi-bin/livecode.cgi 
	#!/Users/peter/Sites/LiveCodeServer/livecode-server
	content-type: text/plain 

	Hello from a LiveCodeServer CGI script

As you can see, LiveCode Server printed it's Shebang line and then executed the script. This stops the script from being able to be run as a script - browsers don't know what to do with the shebang line. This is also an nuisance for anybody wanting to use LiveCode Server for command line scripting.

Should I report this as a bug?

Regards

Peter





More information about the use-livecode mailing list