#!/bin/sh -- # A comment mentioning perl, indented bash's sake. eval 'exec perl -S $0 ${1+"$@"}' if 0; chop($Program = `basename $0`); $tmp = "/tmp/$Program.$$.html"; if ( $ARGV[0] =~ /\?/ ) { $url = $`; $query = $'; } else { exit 1; } $text = <<"END"; POST method wrapper for:

   $ARGV[0]

%VARS%
END foreach $var (split(/\&/, $query)) { ($name, $value) = split(/=/, $var); $value =~ tr/+/ /; $value =~ s/%([a-f0-9][a-f0-9])/pack("C", hex($1))/ieg; $vars .= "\n"; } open(TMP, ">$tmp") || die "$!"; $text =~ s/%URL%/$url/g; $text =~ s/%VARS%/$vars/g; print TMP $text; close(TMP); system("(sleep 30; rm -f $tmp) & url -f $tmp");