btoa(1) btoa(1)
NAME
btoa, atob, tarmail, untarmail - encode/decode binary to
printable ASCII
SYNOPSIS
btoa
atob
tarmail [ -u ] who subject files ...
untarmail [ file ]
DESCRIPTION
btoa is a filter that reads anything from the standard
input, and encodes it into printable ASCII on the standard
output. It also attaches a header and checksum information
used by the reverse filter atob to find the start of the
data and to check integrity.
Atob reads an encoded file, strips off any leading and
trailing lines added by mailers, and recreates a copy of the
the standard output. Atob gives NO output and exits with an
error message if its input is garbage or the checksums do
not check.
Tarmail is a shell script that tar's up all the given files,
pipes them through compress, btoa, and mails them to the
given person with the given subject phrase.
For example:
tarmail ralph "here it is ralph" foo.c a.out
will package up files foo.c and a.out and mail them to ralph
using subject here it is ralph. Notice the quotes on the
subject. They are necessary to make it one argument to the
shell.
The -u option to tarmail is specific to CX/UX and will cause
tar to archive the given file name arguments utilizing a
format recognized by versions of tar distributed by the
University of California at Berkeley (UCB). UCB tar histor-
ically appends a slash (/) by default to the end of all
directory names archived. The / is used by UCB tar to
determine whether a directory is being extracted from the
archive. The CX/UX version of tar used in tarmail complies
with the POSIX 1003.1 and X/Open extended tar format which
does not permit the UCB tar default action. As a result,
CX/UX tarmail archives sent to pre-CX/UX 5.3 and non-CX/UX
systems which utilize the UCB tar will not be readable when
untarmail or tar is used on them. Utilizing this option
will cause CX/UX tar to perform the UCB default action.
Page 1 CX/UX User's Reference Manual
btoa(1) btoa(1)
Tarmail with no args will print a short message reminding
you what the required args are. When the mail is received
at the other end, that person should use mail to save the
message in some temporary file name (say xx). Then saying
untarmail xx will decode the message and untar it. Untar-
mail can also be used as a filter. By using tarmail, binary
files and entire directory structures can be easily
transmitted between machines. Naturally, you should under-
stand what tar itself does before you use tarmail.
Other uses:
compress < secrets | crypt | btoa | mail ralph
will mail the encrypted contents of the file secrets to
ralph. If ralph knows the encryption key, he can decode it
by saving the mail (say in xx), and then running:
atob < xx | crypt | uncompress
(crypt requests the key from the terminal, and the secrets
come out on the terminal).
AUTHOR
Paul Rutter (modified by Joe Orost)
FEATURES
btoa uses a compact base-85 encoding so that 4 bytes are
encoded into 5 characters (file is expanded by 25%). As a
special case, 32-bit zero is encoded as one character. This
encoding produces less output than uuencode(1C).
SEE ALSO
compress(1), crypt(1), uuencode(1C), mail(1)
Page 2 CX/UX User's Reference Manual