#!/usr/bin/env bash MAIL="@kindle.com" while [ -n "$1" ]; do if [ -z "$1" ]; then echo "Submit file to kindle" echo "Usage: kinde.sh " exit 1 fi echo "Sending $1 to ${MAIL}" echo "$1" | mail --content-type "application/x-mobipocket-ebook" --attach "$1" --subject "$1" "${MAIL}" shift done