This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Apache (for win) running bash script: ls


On Mon, 7 Aug 2006 12:30:05, Robert Mark Bram wrote:
>
> When running a bash script under Apache 2.0.55 for Windows, are there any
> restrictions about accessing the file system? My first test is to do an ls and
> report the results:

I think this subject is off-topic here. It is not related to Cygwin at
all. Having stating my objection, here is a test script I use on Linux.

Ehud.


############################## test.cgi ##############################

#! /bin/sh -e

set -f

echo Content-type: text/plain
echo

echo CGI/1.0 test script report:
echo "\n<br>"

echo argc is $#. argv is "$*".
echo "\n<br>"

echo ********* End of output **********
echo "\n<br>"


exec 1>> /tmp/test-cgi.txt
echo "\n"
date "+   ============================== request at %Y-%m-%d %H:%M:%S"

exec 2>&1
##  set -x

echo argc is $#. argv is "$*".
echo "\n"

set +e
PNM=0
while [ $PNM -lt $# ]
do
    PNM=`expr $PNM + 1`
    eval 'PRMN=$'$PNM
    echo "Param $PNM is |$PRMN|" "\n"
done
echo "\n"
set -e

STDI=`cat`
echo " ============================== standard input ====================="
echo -E "$STDI"
echo " ============================= Hebrew converted ===================="
echo -E "$STDI" | iconv -futf8 -thebrew
echo "\n = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ="
echo

echo SERVER_SOFTWARE = $SERVER_SOFTWARE
echo SERVER_NAME = $SERVER_NAME
echo GATEWAY_INTERFACE = $GATEWAY_INTERFACE
echo SERVER_PROTOCOL = $SERVER_PROTOCOL
echo SERVER_PORT = $SERVER_PORT
echo REQUEST_METHOD = $REQUEST_METHOD
echo HTTP_ACCEPT = "$HTTP_ACCEPT"
echo PATH_INFO = "$PATH_INFO"
echo PATH_TRANSLATED = "$PATH_TRANSLATED"
echo SCRIPT_NAME = "$SCRIPT_NAME"
echo QUERY_STRING = "$QUERY_STRING"
echo REMOTE_HOST = $REMOTE_HOST
echo REMOTE_ADDR = $REMOTE_ADDR
echo REMOTE_USER = $REMOTE_USER
echo AUTH_TYPE = $AUTH_TYPE
echo CONTENT_TYPE = $CONTENT_TYPE
echo CONTENT_LENGTH = $CONTENT_LENGTH
echo

echo "env vars and values"
/usr/bin/printenv
echo "end of env =============================="

############################## test.cgi ##############################




--
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 GnuPG: 98EA398D <http://www.keyserver.net/>    Better Safe Than Sorry

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]