1827800 Members
2359 Online
109969 Solutions
New Discussion

Re: uuencode

 
SOLVED
Go to solution
Ragni Singh
Super Advisor

uuencode

Hello, when I ran the following, it produces standard output and not a file. Any idea whats goin on here or is my syntax not correct.

uuencode -m test test1.

points to be assigned.
9 REPLIES 9
Stuart Browne
Honored Contributor

Re: uuencode

UUEncode will always put it's output onto STDOUT.

The reason for the two filenames is for input, and what is encoded into the output.

For example, lets look at the headers involved:

[bekar@elfgrove tmp]$ uuencode data test.txt
begin 644 test.txt
.... encoded data here ...

And with '-m':

[bekar@elfgrove tmp]$ uuencode -m data test.txt
begin-base64 644 test.txt
... encoded data here ...

The idea is you redirect (using >) or pipe (|) the ouput of UUEncode to another application or file.

UUDecode on the other hand will take a filename (or data-stream/pipe), and output a file based on the name on the 'begin' line of the encoded data. This can be overridden with the '-o' flag. This is only available on the UUDECODE application.
One long-haired git at your service...
Donald Kok
Respected Contributor

Re: uuencode

hi,
uuencode writes to standard output. If you want it to write to test1:
uuencode -m test > test1
greetzz
Donald
My systems are 100% Murphy Compliant. Guaranteed!!!
Steven E. Protter
Exalted Contributor

Re: uuencode

Tell me please, what you are trying to accomplish. I'm pretty sure I can help.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ragni Singh
Super Advisor

Re: uuencode

I have a binary file that I am trying to convert to ASCII. I played with uuencode but can't create any file with it.

I tried teh other suggestion with re-direct > but that doesn't work.
Steven E. Protter
Exalted Contributor

Re: uuencode

I'm not sure in this event that uuencode is the best tool to use. Maybe, but these commands might help depending on what kind of file it is.

Consider the following commands:

dos2unix

unix2dos(1) mac2unix(1)


SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Stuart Browne
Honored Contributor

Re: uuencode

So what you want to do is this:

uuencode -m binfile binfile > file.uuencode

Then transfer 'file.uuencode' to the remote machine, and then:

uudecode file.uuencode

This will extract 'binfile'.
One long-haired git at your service...
Donald Kok
Respected Contributor

Re: uuencode

Hi Sanjit,
If you want to grab ascii out of a binary, you can use the strings command:

strings binfile > ascifile

Is this what you want to do ?
Donald
My systems are 100% Murphy Compliant. Guaranteed!!!
Bejoy C Alias
Respected Contributor
Solution

Re: uuencode

u can use 'dd if=file1 of=file2 conv=ascii' to convert ur binary file to ascii .
Be Always Joy ......
Ragni Singh
Super Advisor

Re: uuencode

Great, teh last one worked. I will se the dd for now. You get 10 points buddy.