Skip to Content.
Sympa Menu

baslinux - Re: [BL] CGI in BL 3.50?

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: baslinux AT lists.ibiblio.org
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] CGI in BL 3.50?
  • Date: Thu, 01 Nov 2007 23:34:09 +0100

baslinux AT lists.ibiblio.org skrev:

Now I will write some CGI shell scripts using SQLite and perhaps Yabasic (for diagram images if possible).

Here is one I wrote:

#!/bin/sh
echo "Content-type:text/html"
echo ""
echo "<html><head><title>SQLite queries quotes"
echo "</title></head><body>"
query="SELECT quote, author FROM quotes;"
sqlite -separator ' -- ' mikaelb "$query" 2> null | sed "s|$|\<br\/\>|"
echo "</body></html>"

The mini_httpd runs as user nobody. Since sqlite gives an error about nobody not having a home directory one has to redirect stderr. User nobody doesn't have permission to write to /dev/null, therefore it outputs the error to a file null. One has to give all permission to create files in cgi-bin (chmod +w .).

--
// Mikael Bonnier
----
// Web: http://www.df.lth.se/~mikaelb/
// E-mail/MSN: mikaelb AT df.lth.se
// ICQ # 114635318
// Mob/SMS/MMS: +46730307498
// Phone: +4646323208
// Skype: mikael4u
// PeerCall: 700-100-2180




Archive powered by MHonArc 2.6.24.

Top of Page