$ cat decode_mailto #!/bin/bash perl -lpe 's/%([0-9a-fA-F]{2})/chr(hex($1))/eg;s/mailto:/To: /g;s/subject=/Subject: /g;s/body=/\n/g;s/[&?]/\n/g' $ chmod 755 decode_mailto $ echo 'mailto:[email protected]?subject=qqq&body=www%20eee&' | ./decode_mailto To: [email protected] Subject: qqq www eee $