LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-07-2001, 01:54 AM   #1
JustinHoMi
Member
 
Registered: Apr 2001
Location: Raleigh, NC
Distribution: CentOS
Posts: 154

Rep: Reputation: 30
issue with shell cgi


I'm writing a simple cgi to monitor some things on my system that I check constantly. It's just a shell script, but the problem I'm having is that some of the output doesn't show up on the webpage (the stuff marked "#from here #to here"). If i redirect everything to a file, it views fine on the web. And if I run it on the command line, it outputs fine. It just won't view the marked part on the web. Here's part of the code:

###########################
echo Content-type: text/html
echo

echo "<html><body>"
echo "<b>Halflife process:</b><br>"
ps aux | grep hlds | grep game
echo "<br><br>"
echo "<b>Punkbuster process:</b><br>"
ps aux | grep pb | head -n 1
echo "<br><br>"
echo "<b>Halflife status:</b><br>"

# from here
temp=/usr/jmtemp.$$
kkstat > $temp
num=`wc -l $temp | awk -F" " '{print $1}'`
x=1
while [ $x -le $num ]
do
currline=`head -n $x $temp | tail -n 1`
echo $currline
echo "<br>"
x=`expr $x + 1`
done
# to here

echo "</body></html>"

#######################

kkstat is a small script that logs into my halflife server and outputs a list of player name and status. It takes about 1/3 of a second to run.

Any ideas as to what's going on? It's as if programs that take up just a snippet of cpu time won't output properly.

Any help'd be great

Thanks,
Justin
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP:write a CGI program with shell script supermyself Programming 3 06-12-2005 03:10 PM
how to execute shell scripts from cgi script rajatgarg Linux - General 1 07-08-2004 01:39 PM
cgi and shell scripting, setting it up? GridX Programming 7 04-12-2004 11:01 PM
another cgi and shell scripting problem + webserver prinski Programming 6 04-08-2004 04:25 PM
Running a shell script via CGI-BIN chrisk5527 Linux - General 3 05-09-2003 11:44 AM


All times are GMT -5. The time now is 11:16 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration