From owner-freebsd-questions Mon Mar 25 11:16:58 2002 Delivered-To: freebsd-questions@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id 58BF337B679 for ; Mon, 25 Mar 2002 11:16:12 -0800 (PST) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.12.2/8.12.2) with ESMTP id g2PJCoAd009171; Mon, 25 Mar 2002 13:12:50 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.2/8.12.2/Submit) id g2PJCn8G009169; Mon, 25 Mar 2002 13:12:49 -0600 (CST) Date: Mon, 25 Mar 2002 13:12:49 -0600 From: Dan Nelson To: Drew Tomlinson Cc: Walter Hop , smorton@acm.org, questions@FreeBSD.ORG Subject: Re: Showing Uptime Via webpage Message-ID: <20020325191249.GF14939@dan.emsphone.com> References: <3C9E0754.2010104@verizon.net> <006201c1d423$ee01be00$f82a6ba5@lc.ca.gov> <200203251840.33315@silver.dt1.binity.net> <007a01c1d426$38b2c410$f82a6ba5@lc.ca.gov> <20020325182247.GD14939@dan.emsphone.com> <008401c1d42d$7ad8f420$f82a6ba5@lc.ca.gov> <20020325185056.GE14939@dan.emsphone.com> <00c001c1d430$6596b9a0$f82a6ba5@lc.ca.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00c001c1d430$6596b9a0$f82a6ba5@lc.ca.gov> User-Agent: Mutt/1.3.28i X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In the last episode (Mar 25), Drew Tomlinson said: > The "Hello World" works. You can see it for yourself at > http://mykitchentable.net/cgi-bin/hello if you wish. > > I assumed from your example that to end with the proper CRLF, I > needed to add an '\r'. Tried that but still no output. I also tried > combining the system("uptime") with the hello world script but still > only got the "Hello World" output. So maybe "system" does not work > in cgi scripts? Or do you suspect I have something configured wrong? CRLF's are only required for the headers themselves (including the blank line separating header and data). The data can be just \n-delimited. system() should work fine, but you might want to check its returnvalue and also check your webserver's error log (usually stderr is piped to a log, not to the browser). -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message