If you have mutt installed (a popular text-mode mail reader/writer),
you can get the same thing done without any scripting:

$ echo 'Here you go' |mutt [email protected] -s 'My subject' -a /path/to/file

 :-)

On Thu, Sep 29, 2011 at 2:57 PM, Cal Leeming [Simplicity Media Ltd]
<[email protected]> wrote:
> Hey,
> Little bit off topic, but quite relevant for the busy coder.
> Often I needed to quickly grab a file off a server, or send to a client, but
> it took me 2-3 minutes to fire up an SCP client, find the file, send it etc
> etc.
> So I created a small script (depends on sendmail and uuencode/sharutils) to
> send files via email:
>  [email protected] [~] > cat /usr/sbin/sendfile
> #!/bin/sh
> if [ -z "$1" ] || [ -z "$2" ] || [ ! -f $1 ] ; then
>     echo "syntax: [filename] [email address]"
> else
>     (echo "file attached."; uuencode $1 $1) | mail -s "file attach: $1" $2
>     echo "File sent to $2"
> fi
> Usage:
>  [email protected] [~] > /usr/sbin/sendfile ~/lol
> [email protected]
> File sent to [email protected]
> Hopefully someone else will benefit from these 6 lines of code which saved
> me so much time :)
> Cal
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Bjarni R. Einarsson
Founder, lead developer of PageKite.

Make localhost servers visible to the world: http://pagekite.net/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to