User:Scsbot/formtools/formsubmitbutton


 * 1) prepare to "push" a form submit button, by deleting the rest
 * 1) prepare to "push" a form submit button, by deleting the rest

tag=$1 buttonname=$2

rm="/bin/rm -f"

td=td$tag

if test ! -d $td then echo "$tag not set up" &gt;&amp;2 exit 1 fi

if test ! -f $td/.cur then echo "$tag: no form selected" &gt;&amp;2 exit 1 fi

formid=`cat $td/.cur`

if test ! -d $td/$formid -o ! -f $td/$formid/.toc then echo "$tag: form not set up" &gt;&amp;2 exit 1 fi

while read name type do if test $type = "submit" then if test $name = $buttonname then	: # oughta record found else	$rm $td/$formid/$name fi fi done &lt; $td/$formid/.toc


 * 1) oughta complain if not found

exit 0