Convert a file to an ascii representation that can be safely transmitted through mail gateways, posted on newsgroups, etc.
Nowadays, attaching a file to an email or a newsgroup post is often "behind the scenes" - you don't get involved in the details. And while mail programs do still have to encode attachments, they are more apt to use base64 than uuencode.
Uuencode does have its uses though. You can create a mail message with an attached file simply by:
cat file | uuencode file | mail -s "here's your file" them@somewhere.com
Note that the resulting mail message is not the same as a message created with a MIME attachment, though many mail readers will treat it the same way and allow the recipient to save the file simply by clicking on it. See How can I send attachments from the command line?.
A uuencoded file will look something like this
begin 644 t1 @86)C9&5F9PIA8F-D969G"F%B8V1E9F<*86)C9&5F9PH` ` end
If that file were called "t1.uu", you would recreate "t1" by
uudecode t1.uu
Uudecode handily ignores things that don't belong to it, so t1.uu could look like this and still decode:
Here's the file you need: begin 644 t1 @86)C9&5F9PIA8F-D969G"F%B8V1E9F<*86)C9&5F9PH` ` end Just uudecode this.
You can't send multiple sets that way though; if you have multiple files, tar or cpio them and uuencode that.
More Articles by Tony Lawrence - Find me on Google+
Have you tried Searching this site?
Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.
Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.
Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.
We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.
Click here to add your comments
Don't miss responses! Subscribe to Comments by RSS or by Email
Click here to add your comments
If you want a picture to show with your comment, go get a Gravatar