Uudecode linux что это

Uudecode linux что это

The utility reads file (or by default the standard input) and writes an encoded version to the standard output, or output_file if one has been specified. The encoding uses only printing ASCII characters and includes the mode of the file and the operand name for use by uudecode

The uudecode utility transforms uuencoded files (or by default, the standard input) into the original form. The resulting file is named either name or (depending on options passed to uudecode output_file and will have the mode of the original file except that setuid and execute bits are not retained. The uudecode utility ignores any leading and trailing lines.

The following options are available for :

-m Use the Base64 method of encoding, rather than the traditional algorithm. -o output_file Output to output_file instead of standard output.

The following options are available for uudecode

-c Decode more than one uuencoded file from file if possible. -i Do not overwrite files. -m When used with the — r flag, decode Base64 input instead of traditional input. Without — r it has no effect. -o output_file Output to output_file instead of any pathname contained in the input data. -p Decode file and write output to standard output. -r Decode raw (or broken) input, which is missing the initial and possibly the final framing lines. The input is assumed to be in the traditional encoding, but if the — m flag is used, or if the utility is invoked as b64decode then the input is assumed to be in Base64 format. -s Do not strip output pathname to base filename. By default uudecode deletes any prefix ending with the last slash ‘/’ for security reasons.

EXAMPLES

The following example unpacks all uuencoded files from your mailbox into your current working directory.

The following example extracts a compressed tar archive from your mailbox

Источник

Uudecode linux что это

These commands encode and decode files as follows:

uuencode

The uuencode utility converts a binary file into an encoded representation that can be sent using mail (1). It encodes the contents of source-file , or the standard input if no source-file argument is given. The decode_pathname argument is required. The decode_pathname is included in the encoded file’s header as the name of the file into which uudecode is to place the binary (decoded) data. uuencode also includes the permission modes of source-file (except setuid , setgid , and sticky-bits), so that decode_pathname is recreated with those same permission modes.

uudecode

The uudecode utility reads an encoded-file , strips off any leading and trailing lines added by mailer programs, and recreates the original binary data with the filename and the mode specified in the header.

The encoded file is an ordinary portable character set text file; it can be edited by any text editor. It is best only to change the mode or decode_pathname in the header to avoid corrupting the decoded binary.

OPTIONS

The following options are supported:

uuencode

-m Encodes source-file using Base64 encoding and sends it to standard output.

uudecode

-o outfile Specifies a file pathname that should be used instead of any pathname contained in the input data. Specifying an outfile option-argument of /dev/stdout indicates standard output.This allows uudecode to be used in a pipeline.

-p Decodes encoded-file and sends it to standard output. This allows uudecode to be used in a pipeline.

OPERANDS

The following operands are supported by uuencode and uudecode :

uuencode

decode_pathname The pathname of the file into which the uudecode utility will place the decoded file. If there are characters in decode_pathname that are not in the portable filename character set, the results are unspecified.

source-file A pathname of the file to be encoded.

uudecode

encoded-file The pathname of a file containing the output of uuencode .

USAGE

See largefile (5) for the description of the behavior of uuencode and uudecode when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).

Читайте также:  Как установить bin файлы windows

ENVIRONMENT VARIABLES

See environ (5) for descriptions of the following environment variables that affect the execution of uuencode and uudecode : LANG , LC_ALL , LC_CTYPE , LC_MESSAGES , and NLSPATH .

OUTPUT


uuencode Base64 Algorithm

The standard output is a text file, encoded in the character set of the current locale, that begins with the line:

and ends with the line:

In both cases, the lines have no preceding or trailing blank characters.

The encoding process represents 24-bit groups of input bits as output strings of four encoded characters. Proceeding from left to right, a 24-bit input group is formed by concatenating three 8-bit input groups. Each 24-bit input group is then treated as four concatenated 6-bit groups, each of which is translated into a single digit in the Base64 alphabet. When encoding a bit stream by means of the Base64 encoding, the bit stream is presumed to be ordered with the most-significant bit first. That is, the first bit in the stream is the high-order bit in the first byte, and the eighth bit is the low-order bit in the first byte, and so on. Each 6-bit group is used as an index into an array of 64 printable characters, as shown in the following table.

The character referenced by the index is placed in the output string.

The output stream (encoded bytes) is represented in lines of no more than 76 characters each. All line breaks or other characters not found in the table are ignored by decoding software (see uudecode ).

Special processing is performed if fewer than 24 bits are available at the end of a message or encapsulated part of a message. A full encoding quantum is always completed at the end of a message. When fewer than 24 input bits are available in an input group, zero bits are added on the right to form an integral number of 6-bit groups. Output character positions that are not required to represent actual input data are set to the equals ( = ) character. Since all Base64 input is an integral number of octets, only the following cases can arise: 1. The final quantum of encoding input is an integral multiple of 24 bits. Here, the final unit of encoded output is an integral multiple of four characters with no ‘ = ‘ padding. 2. The final quantum of encoding input is exactly 16 bits. Here, the final unit of encoded output is three characters followed by one ‘ = ‘ padding character. 3. The final quantum of encoding input is exactly 8 bits. Here, the final unit of encoded output is two characters followed by two ‘ = ‘ padding characters.

A terminating » ==== » evaluates to nothing and denotes the end of the encoded data.

uuencode Historical Algorithm

The standard output is a text file (encoded in the character set of the current locale) that begins with the line:

and ends with the line:

In both cases, the lines have no preceding or trailing blank characters.

The algorithm that is used for lines between begin and end takes three octets as input and writes four characters of output by splitting the input at six-bit intervals into four octets, containing data in the lower six bits only. These octets are converted to characters by adding a value of 0x20 to each octet, so that each octet is in the range 0x20-0x5f , and each octet is assumed to represent a printable character. Each octect is then translated into the corresponding character codes for the codeset in use in the current locale. For example, the octet 0x41 , representing ‘ A ‘, would be translated to ‘ A ‘ in the current codeset, such as 0xc1 if the codeset were EBCDIC .

Where the bits of two octets are combined, the least significant bits of the first octet are shifted left and combined with the most significant bits of the second octet shifted right. Thus, the three octets A , B , C are converted into the four octets:

These octets are then translated into the local character set.

Each encoded line contains a length character, equal to the number of characters to be decoded plus 0x20 translated to the local character set as described above, followed by the encoded characters. The maximum number of octets to be encoded on each line is 45.

Читайте также:  Shell windows com fileassoc

EXIT STATUS

The following exit values are returned:

0 Successful completion.

>0 An error occurred.

ATTRIBUTES

See attributes (5) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
Availability SUNWesu
Interface Stability

SEE ALSO


NOTES

The size of the encoded file is expanded by 35% (3 bytes become 4, plus control information), causing it to take longer to transmit than the equivalent binary.

The user on the remote system who is invoking uudecode (typically uucp ) must have write permission on the file specified in the decode_pathname .

If you invoke uuencode and then execute uudecode on a file in the same directory, you will overwrite the original file.

Источник

Uudecode linux что это

The utility reads file (or by default the standard input) and writes an encoded version to the standard output, or output_file if one has been specified. The encoding uses only printing ASCII characters and includes the mode of the file and the operand name for use by uudecode

The uudecode utility transforms uuencoded files (or by default, the standard input) into the original form. The resulting file is named either name or (depending on options passed to uudecode output_file and will have the mode of the original file except that setuid and execute bits are not retained. The uudecode utility ignores any leading and trailing lines.

The following options are available for :

-m Use the Base64 method of encoding, rather than the traditional algorithm. -o output_file Output to output_file instead of standard output.

The following options are available for uudecode

-c Decode more than one uuencoded file from file if possible. -i Do not overwrite files. -m When used with the — r flag, decode Base64 input instead of traditional input. Without — r it has no effect. -o output_file Output to output_file instead of any pathname contained in the input data. -p Decode file and write output to standard output. -r Decode raw (or broken) input, which is missing the initial and possibly the final framing lines. The input is assumed to be in the traditional encoding, but if the — m flag is used, or if the utility is invoked as b64decode then the input is assumed to be in Base64 format. -s Do not strip output pathname to base filename. By default uudecode deletes any prefix ending with the last slash ‘/’ for security reasons.

EXAMPLES

The following example unpacks all uuencoded files from your mailbox into your current working directory.

The following example extracts a compressed tar archive from your mailbox

Источник

linux-notes.org

uuencode — кодирует двоичный файл для передачи с использованием электронной почты. Команда UUENCODE преобразует двоичный файл данных в ASCII. Команда uudecode преобразует данные ASCII, созданные командой UUencode обратно в исходный бинарный формат.

Утилита UUENCODE принимает имя Исходный_файл (стандартный ввод по умолчанию) и производит закодированную версию на стандартный вывод.

Синтаксис.

Флаги.

-m Кодирование выхода, используя алгоритм MIME Base64 . Если опция -m не указана, то будет использоваться старый алгоритм UUENCODE.

Параметры.

  • OutputFile — Задает имя файла для декодирования. Вы можете направить вывод команды UUencode на стандартный вывод, указав /dev/stdout, как файл выхода.
  • SourceFile — Определяет имя двоичного файла, чтобы преобразовать его. По умолчанию это стандартный ввод.

Установка uuencode в Unix/Linux

Чтобы установить утилиту на CentOS/Fedora/RedHat:

Чтобы установить утилиту на Debian/Ubuntu:

Чтобы посмотреть путь где находится утилита, используйте команду:

Команда uuencode в примерах

Для кодирования файла unix1 на локальной системе и после чего, отправить его на другой сервер с именем mysys, для этого введите:

Для кодирования файла /usr/lib/boot/unix2 на локальном компьютере с именем pigmy.goat в файл /tmp/con , введите:

Файлы.

/usr/bin/uuencode — Содержит команды UUencode.

На этом, у меня все, моя тема «Команда uuencode в примерах» завершена.

One thought on “ Команда uuencode в примерах ”

Команда перекодирует все файлы с расширением «txt» и положит перекодированные файлы в заранее созданную папку utf8.

Добавить комментарий Отменить ответ

Этот сайт использует Akismet для борьбы со спамом. Узнайте, как обрабатываются ваши данные комментариев.

Источник

Uudecode

UUE (англ. Uuencode ) — метод представления двоичных данных в текстовой форме, пригодной для передачи через средства, предназначенные только для передачи текстов (например, через e-mail, FTN, транспортное кодирование).

Название происходит от расшифровки названия программ uuencode/uudecode: Unix-To-Unix encoding (decoding). В дальнейшем UUE в интернет-среде (почта, ньюсгруппы) был заменён на Фидонет.

Юю́ки — жаргонное наименование UUE-кодов в Фидонете.

Содержание

Описание формата

UUE данные начинаются со строки begin mode file , где mode — Unix-права доступа к файлу в восьмиричной системе счисления (для DOS/Windows приложений это число всегда 644), а file — имя исходного файла.

При кодировании из файла берутся данные по три байта (в случае, если осталось меньше 3 байт, недостающие заменяются нулями). 24 бита, образующие эти три байта, делятся на четыре группы по 6 бит. Каждая шестибитная группа интерпретируется как число (от 0 до 2 6 − 1 = 63 ), к которому добавляется 32. Получившееся число в диапазоне от 32 до 95 трактуется как код символа в

Каждая группа из 60 символов (соответствует 45 байтам исходного файла) используется для создания отдельной строки. В начале строки указывается количество закодированных символов в строке (во всех строках, кроме последней это число 45, то есть символ ‘M’). Каждая строка завершается символом перевода строки (\n или \n\r в зависимости от платформы).

После окончания данных кодируемого файла помещается строка, содержащая единственный пробел (и перевод строки), и строка с текстом «end».

Иногда в конце строки данных добавляют «пустые символы», обычно символ ` (младшие 6 битов которого равны нулю) для предотвращения повреждения строк некоторыми почтовыми программами.

Пример кодирования

Пример кодирования английского слова Cat.

Исходные символы C a t
ASCII коды (десятич.) 67 97 116
ASCII (двоичн.) 0 1 0 0 0 0 1 1 0 1 1 0 0 0 0 1 0 1 1 1 0 1 0 0
Новые десятичные значения 16 54 5 52
+32 48 86 37 84
Символы UUE 0 V % T

Итоговый результат (закодировано слово Cat):

Таблица используемых символов UUE

Символ десятчиный
ASCII-код
Двоичный код Символ десятчиный
ASCII-код
Двоичный код
(пробел) 32 000 000 @ 64 100 000
! 33 000 001 A 65 100 001
« 34 000 010 B 66 100 010
# 35 000 011 C 67 100 011
$ 36 000 100 D 68 100 100
% 37 000 101 E 69 100 101
& 38 000 110 F 70 100 110
39 000 111 G 71 100 111
( 40 001 000 H 72 101 000
) 41 001 001 I 73 101 001
* 42 001 010 J 74 101 010
+ 43 001 011 K 75 101 011
, 44 001 100 L 76 101 100
45 001 101 M 77 101 101
. 46 001 110 N 78 101 110
/ 47 001 111 O 79 101 111
0 48 010 000 P 80 110 000
1 49 010 001 Q 81 110 001
2 50 010 010 R 82 110 010
3 51 010 011 S 83 110 011
4 52 010 100 T 84 110 100
5 53 010 101 U 85 110 101
6 54 010 110 V 86 110 110
7 55 010 111 W 87 110 111
8 56 011 000 X 88 111 000
9 57 011 001 Y 89 111 001
: 58 011 010 Z 90 111 010
; 59 011 011 [ 91 111 011
62 011 110 ^ 94 111 110
? 63 011 111 _ 95 111 111
` 96 (1) 000 000

Недостатки

  • За счёт использования только 6 битов из 8, потери при кодировании в UUE составляют 33 % (файл размером 1000 Кб займёт 1333 Кб в UUE).
  • Несмотря на узкий диапазон используемых символов, возникают проблемы при передаче UUE через старые компьютеры, использующие не ASCII кодировку (например,

Особенности использования UUE в Фидонете

UUE в Фидонете является стандартом де-факто для передачи двоичных данных. Это объясняется тем, что некоторые узлы отказывались передавать «приложенные» файлы (письма с флагом Att), что обеспечило UUE популярность в качестве альтернативы. В качестве дальнейших средств борьбы с передачей двоичных данных на некоторых узлах настраивали мейлеры и тоссеры на отказ в передаче и тех сообщений, которые содержат UUE. [1]

Для обеспечения совместимости со старым программным обеспечением [2] размер письма во многих эхоконференциях до 2004‑2005 года ограничивался величиною, например, 32 кБ. С учётом служебной информации, добавляемой при распространении почты по Фидонету, письму не рекомендовалось превосходить размер 500 строк (

22 кБ оригинального файла). Файлы большего размера передаются в нескольких письмах, каждое такое письмо содержит одну секцию UUE. При этом в заголовке письма обычно указывается порядковый номер секции, а также общее число секций (в виде [6/55] , где 6 — номер текущей секции, а 55 — общее число секций). Начальный номер секции различается в зависимости от используемого программного обеспечения (0 или 1).

В эхоконференциях возможность использовать UUE регулируется правилами конференции; согласно требованию эхополиси R50, для принятия конференции на региональный бон в её правилах должно быть прописано ограничение на помещение UUE. [3] Существует множество небонных (не находящихся на региональном эхобоне) конференций, специализирующихся на передаче UUE-кодов.

Источник

Читайте также:  Что такое mac os телефоны
Оцените статью