Index: usr.bin/uuencode/uuencode.1 =================================================================== --- usr.bin/uuencode/uuencode.1 (revision 297578) +++ usr.bin/uuencode/uuencode.1 (working copy) @@ -40,6 +40,7 @@ .Sh SYNOPSIS .Nm .Op Fl m +.Op Fl r .Op Fl o Ar output_file .Op Ar file .Ar name @@ -50,6 +51,7 @@ .Op Fl i .Fl o Ar output_file .Nm b64encode +.Op Fl r .Op Fl o Ar output_file .Op Ar file .Ar name @@ -123,6 +125,8 @@ Use the Base64 method of encoding, rather than the traditional .Nm algorithm. +.It Fl r +Produce raw output by excluding the initial and final framing lines. .It Fl o Ar output_file Output to .Ar output_file Index: usr.bin/uuencode/uuencode.c =================================================================== --- usr.bin/uuencode/uuencode.c (revision 297578) +++ usr.bin/uuencode/uuencode.c (working copy) @@ -66,6 +66,7 @@ static FILE *output; static int mode; +static char raw = 0; static char **av; int @@ -82,7 +83,7 @@ if (strcmp(basename(argv[0]), "b64encode") == 0) base64 = 1; - while ((ch = getopt(argc, argv, "mo:")) != -1) { + while ((ch = getopt(argc, argv, "mo:r")) != -1) { switch (ch) { case 'm': base64 = 1; @@ -90,6 +91,9 @@ case 'o': outfile = optarg; break; + case 'r': + raw = 1; + break; case '?': default: usage(); @@ -152,7 +156,8 @@ sequence = 0; - fprintf(output, "begin-base64 %o %s\n", mode, *av); + if (!raw) + fprintf(output, "begin-base64 %o %s\n", mode, *av); while ((n = fread(buf, 1, sizeof(buf), stdin))) { ++sequence; rv = b64_ntop(buf, n, buf2, (sizeof(buf2) / sizeof(buf2[0]))); @@ -162,7 +167,8 @@ } if (sequence % GROUPS) fprintf(output, "\n"); - fprintf(output, "====\n"); + if (!raw) + fprintf(output, "====\n"); } /* @@ -175,7 +181,8 @@ register char *p; char buf[80]; - (void)fprintf(output, "begin %o %s\n", mode, *av); + if (!raw) + (void)fprintf(output, "begin %o %s\n", mode, *av); while ((n = fread(buf, 1, 45, stdin))) { ch = ENC(n); if (fputc(ch, output) == EOF) @@ -209,7 +216,8 @@ } if (ferror(stdin)) errx(1, "read error"); - (void)fprintf(output, "%c\nend\n", ENC('\0')); + if (!raw) + (void)fprintf(output, "%c\nend\n", ENC('\0')); } static void