Web Form - UNIX Script

From: Egli Shelley M <egli_at_space.honeywell.com>
Date: 1996/12/04
Message-ID: <58481n$i51_at_spacenns.space.honeywell.com>#1/1


I'm trying to perform a simple "copy" command within a shell script that is launched from the Web. My form only contains 3 fields: doc nbr, source directory & destination directory that the user fills in. When they submit the form, it is suppose to perform the copy command. The source and destination directory paths contain slashes and I'm wondering if this is my problem area. When I print my values back, they show a "%20" where the directory slash should be. Do I need to add something to my script to decode this? My script is below:

#!/usr/bin/sh

echo 'Content type: text/html'
echo '<HTML>'
echo '<BODY>'
echo '<H1>Basic Checkin Screen</H1>'
echo '<H2>Trying to perform a basic Unix copy command from Web</H2>'
eval `awk 'BEGIN{RS="&";FS="=}
     $1~/^[a-zA-Z] [a-zA-Z0-9_]*$/ {
     printf "QS_%s=%c%s%c\n",$1,39,$2,39}'`
if [ QS_SUBMIT ]; then
  echo '<PRE>'
  if [ $QS_DOCNBR ]; then
    CHECKIN_STRING="Checking in ${QS_DOCNBR}"   else
    CHECKIN_STRING="No checkin at this time"   fi
  echo ${CHECKIN_STRING}

  if [ QS_SUBMIT = "Check-in" ]; then
    cp ${QS_SRCDIR}/${QS_DOCNBR} ${QS_DESDIR}/${QS_DOCNBR}   else
    echo ${CHECKIN_STRING}
  fi
  echo '</PRE>'

else

  echo '<FORM METHOD="POST">'
  echo 'Document Number:'
  echo '<INPUT TYPE="TEXT" NAME="DOCNBR" SIZE="24">'
  echo '<INPUT TYPE="TEXT" NAME="SRCDIR" SIZE="50">'
  echo '<INPUT TYPE="TEXT" NAME="DESDIR" SIZE="50">'
  echo '<INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="Check-in">'
  echo '</FORM>'

fi
echo '</BODY>'
echo '</HTML>' Received on Wed Dec 04 1996 - 00:00:00 CET

Original text of this message