Automating screenshot sharing

I used to create screenshots via scrot tool and and then publish them somewhere like my S3 bucket or to imagesharing sites. But so far it needed two separate actions. Following simple script helps to automate this task.

#!/bin/sh

scrot '%Y%m%d-%H%M%S.png' \
    -e 's3cmd put -P $f s3://files.avsej.net/scrot/ && \
    urxvt -hold -e cowthink -W 80 http://files.avsej.net/scrot/$f'

It creates screenshot, uploads it to my amazon account with s3cmd and then shows me the link.