stupid email tricks
Need to export a file from Linux via email? Got uuencode? Do you even remember uuencode? It’s how we used to encode files for file sharing, back before you were born. Because I’m old.Here’s a handy one-liner that will wrap your file up as a UUEncoded attachment and mail it to the address you specify. The email should come through with a properly formatted attachment that you can then download.Just do this (all on one line):% cat file.zip | uuencode file.zip | mail recipient@example.comOr you can get a bit fancier and add a subject line and a proper from address (if your system doesn’t add one already):% cat file.zip | uuencode file.zip | mail -s “Export of file.zip” -a “From: Me ” recipient@example.comOr you can do it as part of a shell script, with bits that look something like this:FROM=”Just Me “TO=”recipient@example.com”FILE=”file.zip”cat $FILE | uuencode $FILE mail -s “Export of $FILE attached”…