[ale] name=value
Zhongbin Yu " <zyu at premtec.com>
Zhongbin Yu " <zyu at premtec.com>
Thu Jul 15 23:27:47 EDT 1999
I would do it with "cut"
thingIwant=`echo $1|cut -d "=" -f 2`
if $1 is name=123.
And that's a pair of back ticks there.
Caution should be taken when parsing form inputs if the web server is on
the internet. Better use CGI module along wiht taint. Oh, hm, that's perl.
Alright, I'd prefer to use Perl for CGI purpose, personally. If you still
want continue with shell CGI, real UNIX folks will teach you how to use
AWK.
just wanna help.
Jerry Yu
----------------------------------------------------------------------------
Systems Engineer | zyu at tc.net
Premiere Technologies | 404-262-8544(O) 1-800-979-1105 (P)
Atlanta, GA 30326 | ae.tc.net/dept/engineering/op/public/developer/zyu
On Thu, 15 Jul 1999, Bert Hiddink wrote:
#Hello,
#
#I am new on this list and very new on shell scripting.
#
#I have this script:
#
##!/bin/sh
#echo Content-type:text/html
#echo
#
#/usr/local/bin/analog32 +g/usr/home/coninpym/analog/analog.cfg +F-00-
#00-$1 +T-00-00-01
#
#$1 is the variable I need to execute properly the analog32. I works
#when I do this through a link from the web f.e.
#
#http://www.mysite.net/cgi-bin/analog.sh?123
#
#where 123 corresponds to the value of $1.
#
#However, now I want to control this through a form f.e.:
#<INPUT CHECKBOX NAME=analog VALUE=123>
#The problem is that then not only the value is send to the server but
#also the 'name'. So the script receives 'analog=123' instead of
#'123'.
#
#I suppose I should do a split once the variable arrives at the script
#but I do not know where to start. Could you help me?
#
#Thanks in advance and best regards,
#
#-brt
#
#
# Bert Hiddink, FUNDACION GALILEO
# Correo electronico: hiddink at sipromicro.com
# Sitio: http://www.sipromicro.com
# Tel. (506) 280 8683, telefax. (506) 280 8847
#
More information about the Ale
mailing list