[SOLVED] uuencode - I must be in the Twilight Zone
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Many years ago I took an image file, ran it through uuencode (on a Windoze machine), cut 10 columns from the resulting file and have used that data for years as a source of random passwords. Recently I observed that ALL of my passwords start with "M". I obviously changed the first character to M for some reason but I have no idea why. I decided to generate some new passwords.
I installed sharutils on my CentSOS 7 machine. Based on the man page
However, no output file is created. The uuencoded data is displayed in the terminal. If I try redirecting
Quote:
uuencode Greta\ Granstedt.jpg > Greta.uu
control does not return to the terminal until I press Ctrl-D. The resulting file contains
Code:
begin 664 Greta Granstedt.jpg
`
end
I have searched and read at least a half dozen tutorials/examples which seem to confirm this syntax. I tried the same operation on Linux Mint 20. Same thing. It can't be this hard
What am I doing wrong?
TIA,
Ken
p.s. See Greta Grandstedt in "Street Scene" on IMDB. You can probably guess which picture I have chosen
You might try using the "-m" option and see if it does something a bit different.
In the original version of uuencode/uudecode they were expecting their input to be from STDIN and would merge the output into a mail message or decode the mail message and create the output file.
In your case, (due to the command not terminating until ^D was entered), try:
Note: uuencode uses buffered input and assumes that it is not hand typed from a tty. The consequence is that at a tty, you may need to hit Ctl-D several times to terminate input.
I had tried -m. Same issue. The uuencode output looks different of course and is what I would use as a password source (no _ characters.) I tried your suggestion but it failed with a status code of 1 (The operation failed or the command syntax was not valid.)
Code:
uuencode -m <Greta_Granstedt.jpg > Greta.uu
uuencode (GNU sharutils) - encode a file into email friendly text - Ver. 4.13.3
USAGE: uuencode [ -<flag> | --<name> ]... [ in-file ] output-name
Notice that I also removed the space from the input file name. No improvement.
Thanks shruggy,
I read that note and have used Ctrl-D when necessary. Why uuencode? Why not? I thought it was a rather creative process back when I first did it. It SHOULD still work and I would like to get a handle on it. Who knows, I might want to post something to Usenet
The operation failed or the command syntax was not valid.
Because it is invalid. uuencode requires a file name to be specified on the command line. The output goes to stdout nevertheless. The file name is only needed in order to be recorded in the first line of the uuencoded file, so that uudecode could restore it when reading from stdin.
Because it is invalid. uuencode requires a file name to be specified on the command line. The output goes to stdout nevertheless. The file name is only needed in order to be recorded in the first line of the uuencoded file, so that uudecode could restore it when reading from stdin.
THAT is what I forgot. The name is for the output not the input data.
There must be a way to dump the results of uuencode to a FILE. Otherwise people could not have posted all those porno pictures to Usenet and it never would have grown beyond its discussion board roots
Ken
p.s. Perhaps I should use yenc. I remember when that hit Usenet. What a stink!
and it created the first line of the Greta.uu file as
Code:
begin-base64 664 George.jpg
so the first item specified in the command is not related to the file being converted nor the file being created. Is this obvious from the man page? Not to me Actually I think I may have found the root cause of my confusion. Again from the man page
Code:
NOTES
This manual page was AutoGen-erated from the uuencode option definitions.
It has been a LONG time since I used uuencode/uudecode. This and shruggy's last comment reminded me of the original intent of uuencode/uudecode as used with uucp.
And the implementation HAS changed. Originally the file name was supposed to be the input file and optional - if missing it processed stdin, and a second name was the name (mandatory) used for the file when uudecode was used.
For some reason the "file" parameter is currently being ignored.
I found this as the OLD documentation... which is what you interpreted the current manpage to be meaning (I did too when I first read it again), and forgot the "file label" name now identified as the "decode_pathname"
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.