1*2fde3a48SSky Liu.\" $NetBSD: uuencode.1,v 1.26 2014/09/06 21:21:36 wiz Exp $ 2*2fde3a48SSky Liu.\" 3*2fde3a48SSky Liu.\" Copyright (c) 1980, 1990, 1993 4*2fde3a48SSky Liu.\" The Regents of the University of California. All rights reserved. 5*2fde3a48SSky Liu.\" 6*2fde3a48SSky Liu.\" Redistribution and use in source and binary forms, with or without 7*2fde3a48SSky Liu.\" modification, are permitted provided that the following conditions 8*2fde3a48SSky Liu.\" are met: 9*2fde3a48SSky Liu.\" 1. Redistributions of source code must retain the above copyright 10*2fde3a48SSky Liu.\" notice, this list of conditions and the following disclaimer. 11*2fde3a48SSky Liu.\" 2. Redistributions in binary form must reproduce the above copyright 12*2fde3a48SSky Liu.\" notice, this list of conditions and the following disclaimer in the 13*2fde3a48SSky Liu.\" documentation and/or other materials provided with the distribution. 14*2fde3a48SSky Liu.\" 3. Neither the name of the University nor the names of its contributors 15*2fde3a48SSky Liu.\" may be used to endorse or promote products derived from this software 16*2fde3a48SSky Liu.\" without specific prior written permission. 17*2fde3a48SSky Liu.\" 18*2fde3a48SSky Liu.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19*2fde3a48SSky Liu.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20*2fde3a48SSky Liu.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21*2fde3a48SSky Liu.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22*2fde3a48SSky Liu.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23*2fde3a48SSky Liu.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24*2fde3a48SSky Liu.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25*2fde3a48SSky Liu.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26*2fde3a48SSky Liu.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27*2fde3a48SSky Liu.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28*2fde3a48SSky Liu.\" SUCH DAMAGE. 29*2fde3a48SSky Liu.\" 30*2fde3a48SSky Liu.\" @(#)uuencode.1 8.1 (Berkeley) 6/6/93 31*2fde3a48SSky Liu.\" 32*2fde3a48SSky Liu.Dd September 6, 2014 33*2fde3a48SSky Liu.Dt UUENCODE 1 34*2fde3a48SSky Liu.Os 35*2fde3a48SSky Liu.Sh NAME 36*2fde3a48SSky Liu.Nm uuencode , 37*2fde3a48SSky Liu.Nm uudecode 38*2fde3a48SSky Liu.Nd encode/decode a binary file 39*2fde3a48SSky Liu.Sh SYNOPSIS 40*2fde3a48SSky Liu.Nm 41*2fde3a48SSky Liu.Op Fl m 42*2fde3a48SSky Liu.Op Ar inputfile 43*2fde3a48SSky Liu.Ar headername 44*2fde3a48SSky Liu.Nm uudecode 45*2fde3a48SSky Liu.Op Fl m 46*2fde3a48SSky Liu.Op Fl p | Fl o Ar outputfile 47*2fde3a48SSky Liu.Op Ar encoded-file ... 48*2fde3a48SSky Liu.Sh DESCRIPTION 49*2fde3a48SSky Liu.Nm 50*2fde3a48SSky Liuand 51*2fde3a48SSky Liu.Nm uudecode 52*2fde3a48SSky Liuare used to transmit binary files over transmission mediums 53*2fde3a48SSky Liuthat do not support other than simple 54*2fde3a48SSky Liu.Tn ASCII 55*2fde3a48SSky Liudata. 56*2fde3a48SSky Liu.Pp 57*2fde3a48SSky LiuThe following options are available: 58*2fde3a48SSky Liu.Bl -tag -width ".Fl m" 59*2fde3a48SSky Liu.It Fl m 60*2fde3a48SSky LiuUse base64 encoding. 61*2fde3a48SSky LiuFor 62*2fde3a48SSky Liu.Nm , 63*2fde3a48SSky Liuthe historical uuencode algorithm is the default. 64*2fde3a48SSky LiuFor 65*2fde3a48SSky Liu.Nm uudecode , 66*2fde3a48SSky Liuby default the encoding is automatically detected. 67*2fde3a48SSky Liu.It Fl o Ar outputfile 68*2fde3a48SSky Liu.Po Nm uudecode No only . Pc 69*2fde3a48SSky LiuSend the decoded output data to 70*2fde3a48SSky Liu.Ar outputfile . 71*2fde3a48SSky LiuBy default, 72*2fde3a48SSky Liu.Nm uudecode 73*2fde3a48SSky Liuuses the 74*2fde3a48SSky Liu.Ar headername 75*2fde3a48SSky Liurecorded in the header of the encoded data stream. 76*2fde3a48SSky Liu.It Fl p 77*2fde3a48SSky Liu.Po Nm uudecode No only . Pc 78*2fde3a48SSky LiuWrite the decoded file to standard output instead of to a file. 79*2fde3a48SSky Liu.El 80*2fde3a48SSky Liu.Pp 81*2fde3a48SSky Liu.Nm 82*2fde3a48SSky Liureads 83*2fde3a48SSky Liu.Ar inputfile 84*2fde3a48SSky Liu(or by default the standard input) and writes an encoded version 85*2fde3a48SSky Liuto (always) the standard output. 86*2fde3a48SSky LiuThe encoding uses only printing 87*2fde3a48SSky Liu.Tn ASCII 88*2fde3a48SSky Liucharacters suitable for text-only transport media. 89*2fde3a48SSky LiuThe string 90*2fde3a48SSky Liu.Ar headername 91*2fde3a48SSky Liuis inserted into the output header as the 92*2fde3a48SSky Liu.Ar outputfile 93*2fde3a48SSky Liuto use at 94*2fde3a48SSky Liu.Nm uudecode 95*2fde3a48SSky Liutime. 96*2fde3a48SSky LiuThe header also includes the mode (permissions) of the file. 97*2fde3a48SSky Liu.Pp 98*2fde3a48SSky Liu.Nm uudecode 99*2fde3a48SSky Liutransforms 100*2fde3a48SSky Liu.Em uuencoded 101*2fde3a48SSky Liufiles (or by default, the standard input) into the original form. 102*2fde3a48SSky LiuThe resulting file is named 103*2fde3a48SSky Liu.Ar headername 104*2fde3a48SSky Liuas recorded in the encoded file, 105*2fde3a48SSky Liuor as specified by the 106*2fde3a48SSky Liu.Fl o 107*2fde3a48SSky Liuoption, 108*2fde3a48SSky Liuand will have the mode of the original file except that setuid 109*2fde3a48SSky Liuand execute bits are not retained. 110*2fde3a48SSky LiuIf the 111*2fde3a48SSky Liu.Fl p 112*2fde3a48SSky Liuoption is specified, or if the output file name is given as 113*2fde3a48SSky Liu.Pa /dev/stdout , 114*2fde3a48SSky Liuthen the data will be written to the standard output 115*2fde3a48SSky Liuinstead of to a named file. 116*2fde3a48SSky Liu.Nm uudecode 117*2fde3a48SSky Liuignores any leading and trailing lines. 118*2fde3a48SSky Liu.Pp 119*2fde3a48SSky LiuThe encoded form of the file is expanded by 35%. 120*2fde3a48SSky LiuEvery 3 bytes become 4 plus control information. 121*2fde3a48SSky Liu.Sh EXIT STATUS 122*2fde3a48SSky LiuThe 123*2fde3a48SSky Liu.Nm uudecode 124*2fde3a48SSky Liuand 125*2fde3a48SSky Liu.Nm 126*2fde3a48SSky Liuutilities exits 0 on success, and \*[Gt]0 if an error occurs. 127*2fde3a48SSky Liu.Sh EXAMPLES 128*2fde3a48SSky LiuThe following example packages up a source tree, compresses it, 129*2fde3a48SSky Liuuuencodes it and mails it to a user on another system. 130*2fde3a48SSky Liu.Pp 131*2fde3a48SSky Liu.Bd -literal -offset indent -compact 132*2fde3a48SSky Liutar czf \- src_tree \&| uuencode src_tree.tgz \&| mail user@example.com 133*2fde3a48SSky Liu.Ed 134*2fde3a48SSky Liu.Pp 135*2fde3a48SSky LiuOn the other system, if the user saves the mail to the file 136*2fde3a48SSky Liu.Pa temp , 137*2fde3a48SSky Liuthe following example creates the file 138*2fde3a48SSky Liu.Pa src_tree.tgz 139*2fde3a48SSky Liuand extracts it to make a copy of the original tree. 140*2fde3a48SSky Liu.Pp 141*2fde3a48SSky Liu.Bd -literal -offset indent -compact 142*2fde3a48SSky Liuuudecode temp 143*2fde3a48SSky Liutar xzf src_tree.tgz 144*2fde3a48SSky Liu.Ed 145*2fde3a48SSky Liu.Sh SEE ALSO 146*2fde3a48SSky Liu.Xr gzip 1 , 147*2fde3a48SSky Liu.Xr mail 1 , 148*2fde3a48SSky Liu.Xr tar 1 , 149*2fde3a48SSky Liu.\".Xr uucp 1 , 150*2fde3a48SSky Liu.Xr uuencode 5 151*2fde3a48SSky Liu.Sh STANDARDS 152*2fde3a48SSky LiuThe 153*2fde3a48SSky Liu.Nm uudecode 154*2fde3a48SSky Liuand 155*2fde3a48SSky Liu.Nm 156*2fde3a48SSky Liuutilities conform to 157*2fde3a48SSky Liu.St -p1003.1-2008 . 158*2fde3a48SSky Liu.Sh HISTORY 159*2fde3a48SSky LiuThe 160*2fde3a48SSky Liu.Nm uudecode 161*2fde3a48SSky Liuand 162*2fde3a48SSky Liu.Nm 163*2fde3a48SSky Liuutilities appeared in 164*2fde3a48SSky Liu.Bx 4.0 . 165*2fde3a48SSky Liu.Sh SECURITY CONSIDERATIONS 166*2fde3a48SSky LiuWhen using 167*2fde3a48SSky Liu.Nm uudecode 168*2fde3a48SSky Liuwith files coming from dubious sources, 169*2fde3a48SSky Liualways either explicitly pass the 170*2fde3a48SSky Liu.Fl o 171*2fde3a48SSky Liuoption or check the header (the first line) of the encoded file for 172*2fde3a48SSky Liusafety. 173*2fde3a48SSky LiuBlindly using a 174*2fde3a48SSky Liu.Ar headername 175*2fde3a48SSky Liufrom a hostile source can overwrite important files. 176