Created
November 9, 2010 13:42
-
-
Save adolfont/669085 to your computer and use it in GitHub Desktop.
Script para enviar arquivos para a amazon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# mandamazon.sh: Shell script para mandar arquivos para o seu Amazon Kindle direto da linha de comando do Linux | |
# Autor: Adolfo Neto (http://twitter.com/adolfont) | |
# | |
## Necessário ter o programa "mutt" instalado e configurado. | |
## Veja como em http://www.linuxuser.co.uk/tutorials/get-started-with-mutt/ | |
[email protected] | |
MENSAGEM_USO=" | |
Uso: $(basename "$0") [OPÇÕES] | $(basename "$0") ARQUIVO [EMAIL] | |
Envia ARQUIVO para o seu EMAIL do Kindle | |
OPÇÕES: | |
-h, --help Mostra esta tela de ajuda e sai | |
Exemplo(s): | |
$(basename "$0") artigo.pdf | |
Envia artigo.pdf para seu email (configurado no script) do Kindle | |
$(basename "$0") artigo.pdf [email protected] | |
Envia artigo.pdf para o email [email protected] | |
" | |
if test "$2" != "" | |
then | |
EMAIL=$2 | |
fi | |
case "$1" in | |
-h | --help) | |
echo "$MENSAGEM_USO" | |
exit 0 | |
;; | |
*) | |
echo "Enviando "$1" para o seu Kindle pelo email "$EMAIL" " | |
echo \"Enviando "$1"\" | mutt -s \"Enviando "$1"\" $EMAIL -a "$1" | |
;; | |
esac | |
# Para aprender Shell Script, leia: | |
# JARGAS, Aurélio Marinho. Shell Script Profissional. São Paulo: Novatec Editora, 2008. | |
# Página do livro: http://www.shellscript.com.br/ | |
# Twitter do autor: http://twitter.com/oreio |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment