User:Scsbot/formtools/formsubmit

tag=$1 baseurl=$2 cookiefile=$3

baseurl2=`expr "$baseurl" : '\([^/]*//[^/]*\).*'`

tf3=tf$$.3

rm="/bin/rm -f"

submurl=`cat \`formgettmpfile $tag .action\``	# XXX submmethod=`cat \`formgettmpfile $tag .method\``	# XXX

if test $submmethod != "post" then echo "unexpected (form method $submmethod)" &gt;&amp;2 exit 1 fi

if expr "$submurl" : '^/' &gt; /dev/null then	: else echo "unexpected (non-relative submission URL $submurl)" &gt;&amp;2 exit 1 fi

submurl=`echo "$submurl" | sed 's/&amp;amp;/\&amp;/g'`
 * 1) XXX:

sep=abcdefghijklmnopqrstuv

formmakesubm $tag $sep | sed 's/$//' &gt; $tf3

httpget -cookies -cookiefile $cookiefile -post -type "multipart/form-data; boundary=$sep" "$baseurl2/$submurl" &lt; $tf3

$rm $tf3

exit 0