LiveCodeServer - Prints shebang line

Monte Goulding monte at sweattechnologies.com
Tue Jul 15 21:46:25 EDT 2014


Hi Peter

One of the contributions I made just prior to christmas was to handle the shebang and basically put the script into <?lc mode immediately if there's a shebang. I really didn't get much of a chance to experiment with it but it was merged in. Unfortunately I can't remember which version of LC but perhaps try one of the latest server versions???

Cheers

Monte

On 16 Jul 2014, at 11:42 am, Peter W A Wood <peterwawood at gmail.com> wrote:

> 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
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

--
M E R Goulding 
Software development services
Bespoke application development for vertical markets

mergExt - There's an external for that!




More information about the use-livecode mailing list