.\" Copyright (c) 1980, 1990, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" @(#)uuencode.1 8.1 (Berkeley) 6/6/93 .\" %FreeBSD: src/usr.bin/uuencode/uuencode.1,v 1.26 2003/03/18 14:24:47 fanf Exp % .\" $FreeBSD$ .\" .Dd January 27, 2002 .Dt UUENCODE 1 .Os .Sh 名称 .Nm uuencode , .Nm uudecode , .Nm b64encode , .Nm b64decode .Nd バイナリファイルのエンコード、デコード .Sh 書式 .Nm .Op Fl m .Op Fl o Ar output_file .Op Ar file .Ar name .Nm uudecode .Op Fl cimprs .Op Ar .Nm uudecode .Op Fl i .Fl o Ar output_file .Nm b64encode .Op Fl o Ar output_file .Op Ar file .Ar name .Nm b64decode .Op Fl cimprs .Op Ar .Nm b64decode .Op Fl i .Fl o Ar output_file .Op Ar file .Sh 解説 .Nm および .Nm uudecode のユーティリティは、 .Tn ASCII データ以外のデータ転送をサポートしてない伝送路を用いてバイナリファイル を送る場合に用いられます。 .Nm b64encode ユーティリティは、 .Fl m フラグが指定された .Nm の同義語です。 .Nm b64decode ユーティリティは、 .Fl m フラグが指定された .Nm uudecode の同義語です。 .Pp .Nm ユーティリティは、 .Ar file (無指定時には標準入力) よりデータを読み込み、符号化されたデータを標準 出力または .Ar output_file が指定された場合にはそこに書き込みます。 出力データには、 .Tn ASCII キャラクタしか含まれません。また、このデータには、 .Nm uudecode を用いて元のファイルを復元する時に必要となるファイルのモードと .Ar name が含まれます。 .Pp .Nm uudecode ユーティリティは、 .Em uuencode によって生成されたファイル (もしくは、標準入力からのデータ) を元の形式 に変換します。生成されるファイルは、 .Nm uudecode 時に指定された名前 ( .Ar name ) または ( .Nm uudecode に指定されたオプションに依存して) .Ar output_file になり、ファイルモードなどは変換前のものが採用されますが、 setuid ビットと実行ビットは引き継がれません。 .Nm uudecode ユーティリティは、前後の行をすべて無視します。 .Pp 以下のオプションを .Nm で使用可能です: .Bl -tag -width ident .It Fl m 伝統的な .Nm アルゴリズムの代りに Base64 方式でエンコードします。 .It Fl o Ar output_file 標準出力にではなく .Ar output_file に出力します。 .El .Pp 以下のオプションを .Nm uudecode で使用可能です: .Bl -tag -width ident .It Fl c .Ar file から、可能であるならば複数の uuencode されたファイルをデコードします。 .It Fl i ファイルの上書きをしません。 .It Fl m .Fl r フラグと共に使用された場合、伝統的な .Nm 入力の代りに Base64 入力をデコードします。 .Fl r が無い場合には、このフラグは無効です。 .It Fl o Ar output_file 入力データに含まれるパス名のファイルにではなく、 .Ar output_file に出力します。 .It Fl p .Ar file をデコードし、標準出力に出力します。 .It Fl r 最初や最後のフレーミング行が無い、生の (または壊れた) 入力をデコードします。 入力は、伝統的な .Nm エンコードが仮定されます。 .Fl m フラグ使用時や、 .Nm b64decode として起動された場合、入力は Base64 形式が仮定されます。 .It Fl s 出力パス名をベース名に縮めません。 セキュリティのために、デフォルトでは .Nm は最後のスラッシュ '/' より前のプレフィックスを除去します。 .El .Sh 使用例 ソースツリーを compress し、uuencode し、別のシステムにメールで送る例を 以下に示します。 .Nm uudecode が転送される側のシステムで実行されると、 ``src_tree.tar.Z'' が生成されます。 このファイルはその後 uncompress され、元のツリーが展開されるでしょう。 .Pp .Bd -literal -offset indent -compact tar cf \- src_tree \&| compress \&| uuencode src_tree.tar.Z \&| mail sys1!sys2!user .Ed .Pp 以下の例では、すべての uuencode されたファイルを、 あなたのメールボックスから現在の作業ディレクトリへ展開します。 .Pp .Bd -literal -offset indent -compact uudecode -c < $MAIL .Ed .Pp 以下の例では、compress された tar アーカイブをあなたのメールボックスから 展開します。 .Pp .Bd -literal -offset indent -compact uudecode -o /dev/stdout < $MAIL | zcat | tar xfv - .Ed .Sh 関連項目 .Xr basename 1 , .Xr compress 1 , .Xr mail 1 , .Xr uucp 1 , .Xr uuencode 5 .Sh バグ 符号化されたファイルの大きさは、元のファイルの大きさに比較して 35% ほ ど大きくなります。これは、3byte のデータを 4byte + 制御符号に変換する ためです。 .Sh 歴史 .Nm および .Nm uudecode は .Bx 4.0 から登場しました。