Revision: 31309
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at September 2, 2010 17:34 by rkumar
Initial Code
#!/bin/bash ## vim:ts=4:sw=4:tw=100:ai:nowrap:formatoptions=croqln: file=${1} echo -n "Enter body:" read body echo -n "Enter Subject: " read subject [[ -z "$body" ]] && { body="Sending attachment using mail"; } [[ -z "$subject" ]] && { subject="backup: $file "; } [[ -z "$file" ]] && { echo "Error: file blank." 1>&2; exit 1; } { echo -e "$body"; uuencode "$file" "$file"; } | mail -s "$subject" ${GMAIL_USER}@gmail.com ;
Initial URL
Initial Description
Initial Title
mail a file as attachment command line
Initial Tags
script
Initial Language
Bash