Operating System - Linux
1827439 Members
6129 Online
109965 Solutions
New Discussion

Can't "put" and "take" with cu under linux?

 
SOLVED
Go to solution
Debbie Fleith
Regular Advisor

Can't "put" and "take" with cu under linux?

We can't seem to be able to transfer ascii files to our remote Linux server while dialed into the system directly with "cu" from an HP-UX server.

Is there an alternative command to use with "cu" for this purpose under Linux? Or, do we have to use FTP for file transfer? (We don't always have a RAS to use with FTP, so that is a problem for us)
4 REPLIES 4
Kodjo Agbenu
Honored Contributor

Re: Can't "put" and "take" with cu under linux?

Hello Debbie,

What exactly is the behaviour when you try to transfer files ?

You may know that problems can occur during file transfer via modems (even via FTP, but less often) when some special characters are encountered and taken by the device as control characters.

Therefore, the best way to make sure the transfer will take place correctly is to uuencode the files. This means converting the files into a 7-bit format, transfer it, then re-assemble 7-bit data units to retrieve the original data (uudecode).

Example : you have 3 files to transfer, let's say file1, file2, file3.

To reduce transfer size, you may want to tar then gzip as follows :

tar cvf file.tar file1 file2 file3 ; gzip file.tar

After that, uuencode the result as follows :

uuencode file.tar.gz file.tar.gz >file.uue

Transfer your file (TAKE, PUT).

After that, uudecode, then guzip and untar the file :

uudecode file.uue
gunzip file.tar.gz
tar xvf file.tar


Hope this helps.
Good luck.

Kodjo.

P.S. Don't forget to rate this answer (from 1 to 10).


Learn and explain...
Debbie Fleith
Regular Advisor

Re: Can't "put" and "take" with cu under linux?

I couldn't get uuencode to work on the Linux side.

I only need to transfer one file at a time, so I tried "uuencode file > file.uue"; "uuencode file"; and "uuencode file file.uue"
--- none of these commands worked. They all hung.

Any further ideas?
Tom Dawson
Regular Advisor
Solution

Re: Can't "put" and "take" with cu under linux?

Debbie,

The man page for uuencode says:

uuencode [-m] [ file ] name

The "-m" causes Base64 encoding. That's a matter of personal preference. It looks like you are missing the second argument "name". I would try this:

uuencode file file > file.uue

The second "file" ( "name" from the man page ) is the name that uuencode embeds at the beginning of the uuencoded file. When uudecode operates on this file at the remote end, it reads that name and places the output into a file with that name. So if I had a picture file I wanted to encode, I would do this:

uuencode picture.jpg picture.jpg > picture.uue

There is nothing sacred about the "uue" extension. But if you opened the picture.uue file with vi, you would see "picture.jpg" on the first line. That is what uudecode will use.

HTH,
Tom
Kodjo Agbenu
Honored Contributor

Re: Can't "put" and "take" with cu under linux?

Hello,

Thank you Tom for your help. Sorry Debbie, my syntax was right but I forgot to explain it.

Regards,

Kodjo
Learn and explain...