Sponsored Content
Full Discussion: cgi scripting help needed
Top Forums Shell Programming and Scripting cgi scripting help needed Post 302336479 by kshji on Wednesday 22nd of July 2009 08:43:07 AM
Old 07-22-2009
Here is some example template to make html, also how to use cgi variables = look env
Code:
#!/bin/ksh
cat <<EOF
Content-type: text/html

<html>
<body>
$QUERY_STRING
- all other values, look env variables
$(env)
<hr>
EOF

style="color:red;"
# make your calculation here
# then output
((value < 70 ))  && style="color:green;"

cat <<EOF
You can call cmd also<br />
Date: $( date '+%Y-%m-%d %H:%M:%S' ) <br />

<div style="$style">
free .
total used free shared buffers cached
$somevariable and  $var2 ...
Put your data here with variables
</div>

HERE is nice template method ex. using in cgi-scripts.
</body>
</html>
EOF

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Writing CGI scripting using perl

Hi All, I am trying to do the following thing. I am entering name & email id & then in action i am calling a .cgi program that sends a email to the email id entered. I am facing a small problem, once i have entered the details , its printing the contents of .cgi file in browser. there is a... (7 Replies)
Discussion started by: alma
7 Replies

2. Shell Programming and Scripting

sh scripting! Help Needed

Hello fellas or ladies. I am new on this site and new to the unix operating system. I have been working with UNIX and i love it so far, i learned some stuff and most of the beneficiary command but I need help renaming all the files in my directory and doing them one by one is just tiring.... (1 Reply)
Discussion started by: keyboardkowboy
1 Replies

3. Solaris

executing cgi programs in solaris(B89) needed urgent help,pls!

Hi all, I am trying to execute cgi scripts on solaris, but everytime i get a internal server error... The syntax of my .cgi script is correct as ive checked.. Steps i followed 1.started apache 2.The UNIX and Linux Forums - Learn UNIX and Linux from Experts (in opera) 3.places my cgi scripts... (7 Replies)
Discussion started by: wrapster
7 Replies

4. Shell Programming and Scripting

Help needed with scripting.

Hello Friends, I am very new to scripting and currently have come across a situation where I need to create a UNIX script which would look for certain text in a file and then email me if it finds it. I am trying to trouble shoot an issue with our internet websites and I need to know when I... (1 Reply)
Discussion started by: mahive
1 Replies

5. Shell Programming and Scripting

CGI scripting Error

I am trying to execute following program #!/usr/bin/perl -wT use CGI qw(:standard); print start_html("Hello world"); and getting an error (offline mode: enter name=value pairs on standard input) i am a beginner so please try to explain it as much as possible. ---------- Post updated... (4 Replies)
Discussion started by: bhavesh.sapra
4 Replies

6. Homework & Coursework Questions

Scripting needed

Hi, My task is to check the file test.txt every 15 min from Mon-Fri 9:00AM - 6:00PM. We get this file from our mainframes, every 15 min it will update the same file. My task is to compare file timestamp with current system time stamp and check if the file is updated or not. If the file doesn't... (0 Replies)
Discussion started by: chinniforu2003
0 Replies

7. Shell Programming and Scripting

Help needed in scripting

Hi Guys, I need help in scripting out the below : this is a sample data i have in my file: jobname type 8:00:00 AM I need to remove the ":00" from the time field alone. Thanks in advance for all ur help (8 Replies)
Discussion started by: a12ka4
8 Replies

8. Shell Programming and Scripting

Perl CGI Scripting

Hi, My below cgi script works fine from the command line but not working from the web browser. #!/usr/bin/perl use File::Copy; use CGI; print "Content-type: text/html\n\n"; print "<html><head><title>LOGS"; print "</title></head>"; print "<body bgcolor=#95B9C7 link=black>"; ... (4 Replies)
Discussion started by: liyakathali
4 Replies

9. Shell Programming and Scripting

Web Service in Perl CGI scripting

Hi, I have a requirement to write web service in Perl CGi scripting.The web service will be called by some external programs.Any help would be appreciated.Sample hello world program will be more helpful. Thanks, Liyakath Ali. (1 Reply)
Discussion started by: liyakathali
1 Replies
UPSSTATS.CGI(8) 						    NUT Manual							   UPSSTATS.CGI(8)

NAME
upsstats.cgi - Web-based UPS status viewer SYNOPSIS
upsstats.cgi Note As a CGI program, this should be invoked through your web server. If you run it from the command line, it will either complain about unauthorized access or spew a bunch of HTML at you. DESCRIPTION
upsstats.cgi uses template files to build web pages containing status information from UPS hardware. It can repeat sections of those template files to monitor several UPSes simultaneously, or focus on a single UPS. These templates can also include references to upsimage.cgi(8) for graphical displays of battery charge levels, voltage readings, and the UPS load. ACCESS CONTROL
upsstats will only talk to upsd(8) servers that have been defined in your hosts.conf(5). If it complains that "Access to that host is not authorized", check that file first. TEMPLATES
The web page that is displayed is actually a template containing commands to upsstats which are replaced by status information. The default file used for the overview is upsstats.html. When monitoring a single UPS, the file displayed is upsstats-single.html. The format of these files, including the possible commands, is documented in upsstats.html(5). FILES
hosts.conf(5), upsstats.html(5), upsstats-single.html SEE ALSO
upsimage.cgi(8) Internet resources: The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ Network UPS Tools 05/22/2012 UPSSTATS.CGI(8)
All times are GMT -4. The time now is 10:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy