#!/bin/bash boundary=epoch-`date +%s` echo "--$boundary Content-Type: application/soap+xml Content-Location: root --$boundary Content-Type: `java -classpath ~/bin MimeType $1` Content-Transfer-Encoding: binary Content-Id: " `cat $1` " --$boundary-- " | curl -s --data-binary @- -H 'Content-Type: multipart/related; type="text/xml"; boundary="'$boundary'"' $2