1834009 Members
3917 Online
110063 Solutions
New Discussion

Re: RCP Problems...

 
Rafael Mendonça Braga
Regular Advisor

RCP Problems...

Hello All... I'm trying to copy files between HPUX 11i servers and OpenVms servers... The problem is the following:

When I'm connected as root to an HPUX server and try to copy a file from a OpenVms server through a command like this (example only):
rcp a.lis oracle@server-vms:'"des02:[user.ssb.ssbrmb]a.lis"'

I can copy the file, but not as the file really is...

For example... The structure of the file "a.lis" is this:

xxxxxxaabbccff
aaabbbgggxxxxx
yyyuuurtrttddd

And when I copy it to the Unix trhough RCP, the structure of the file is changed to one line only:

xxxxxxaabbccffaaabbbgggxxxxxyyyuuurtrttddd

Do you understand??

What am I doing wrong in this command??

Someone can help Me?

Thanks,

Rafael M. Braga
4 REPLIES 4
Stuart Abramson
Trusted Contributor

Re: RCP Problems...

I don't think that you are having a command problem. You're having a "file format" problem. The OpenVMS file isn't using the same "end-of-line sequence" that HP-UX is expecting. You have to figure it out...

I assume that this is a text file.

Do an hex dump of an HP-UX file and then an OpenVMS file and see what the end of lines look like:

$ xd -xc file
0000000 3131 0a31 3169 0a50 544f 0a62 696e 0a65
1 1 \n 1 1 i \n P T O \n b i n \n e
0000010 6d63 0a66 696c 650a 6b73 6872 632e 7478
m c \n f i l e \n k s h r c . t x
0000020 740a 6e65 7762 696e 0a70 726f 6669 6c65
t \n n e w b i n \n p r o f i l e
0000030 2e74 7874 0a74 6d70 0a00
. t x t \n t m p \n
0000039

HP-UX text files end in "0a" (\n).
Ralph Grothe
Honored Contributor

Re: RCP Problems...

Hi Rafael,

since I have no VMS experience at all I think I'm not in a position to reply to this thread.
But I thought the problem is a more general conversion problem.

In the first place I would expect that such conversions being handled by your rcp client silently behind the scenes.
Have you consulted its documentation for any special options/arguments/settings etc.?

If you cannot work it out that way, how about piping the file through a converter like dd?
Sorry, I even don't know if there exists the notion of pipes and utilities such as dd on VMS.
If I used Unix sysntax I would fancy something like this

remsh oracle@server-vms dd if=a.lis conv=unblock | cat > /some_path/some_file

Refer to the dd manpage for the various conversion options.

Maybe you could use Perl for your task?
I hear there are ports for VMS as well.
If so have a look at these modules for instance:

perldoc File::Spec::VMS
perldoc File::Copy

Madness, thy name is system administration
Jordan Bean
Honored Contributor

Re: RCP Problems...

If the transfer is performed from HP-UX and OpenVMS uses the same end-of-line as DOS/Windows, then try these methods:

To upload to OpenVMS server:
$ ux2dos file > file.vms
$ rcp file.vms oracle@vms:file

To download from OpenVMS server:
$ rcp oracle@vms:file file.vms
$ dos2ux file.vms > file


Rafael Mendonça Braga
Regular Advisor

Re: RCP Problems...

Thanks!