Monday, July 29, 2013

shell-script hacks


1- send attachment using shell script

(printf "%s\n" \
    "Subject: test" \
    "To: $USER" \
    "Content-Type: application/zip" \
    "Content-Disposition: attachment; filename=image.tar.gz" \
    "Content-Transfer-Encoding: base64" \
    "";
 base64 image.tar.gz) | /usr/sbin/sendmail "$EMAIL_ID"