Home Knowledge Articles IBM Cognos 8 BI Show CGI variables on UNIX
Follow us on Twitter


Countries

50.1%United States United States
7.6%India India
7%United Kingdom United Kingdom
5.1%Australia Australia
4.8%Canada Canada

Visitors

Today: 36
Yesterday: 111
Last Week: 3359
This Month: 9188
Last Month: 16191
Total: 382841


Show CGI variables on UNIX PDF Print E-mail
(0 votes, average 0 out of 5)
Written by Martijn Christenhusz   
Wednesday, 20 May 2009 20:59

With the script in this document you can see which CGI variables are known on your UNIX system. Create a new file called for example showenv.cgi

1. Save this file in the <install dir>/c8/webcontent directory.

2. Open a web browser and execute script
http://<unixserver>/cognos8/showenv.cgi

3. in your browser you will see all CGI variables and their content of your UNIX system


#!/bin/sh


TmpOutFile=/tmp/webenv_control.$$
rm -f $TmpOutFile

subst_html()
{
  echo $1 | sed -e 's^%2F^/^g'
}


# Get parameter and analyse them
if [ "$REQUEST_METHOD" = "GET" ]
then
  pl=`echo $QUERY_STRING | sed -e 's-&- -g'`
else
  read inData
  pl=`echo $inData | sed -e 's-&- -g'`
fi

set -- $pl
pc=1
while [ $# -gt 0 ]
do
  p=`echo $1 | awk '{print $1}' FS==`
  v=`echo $1 | awk '{print $2}' FS==`

  pc=`expr $pc + 1`
  shift

  echo "<tr><td>$p</td><td>$v</td></tr>" >> $TmpOutFile

done


echo ""
echo "<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\">"
echo "<html>"
echo "<title>Show Wen Environments - Cognos</title>"
echo "<body>"
if [ $pc -gt 1 ]
then
  echo "<table border=1>"
  cat $TmpOutFile | sort
  echo "</table>"
fi
echo "<p>Environment variable:</p>"
echo "<table border=1>"
env | sort | sed -e 's-^-<tr><td>-' -e 's-=-</td><td>-' -e 's-$-</td></tr>-'
echo "</table>"
echo "</body>"
echo "</html>"

rm -f $TmpOutFile
exit 0

 

Comments

Please login to post comments or replies.
Last Updated on Thursday, 28 January 2010 19:31
 
 

Login

For more content en features!



CogKnowHow Newsletter

Season's Greetings


Receive HTML?

Polls

How many users are working on your Cognos environment?