1839263 Members
2452 Online
110137 Solutions
New Discussion

name pipe

 
HartfordBala1973
Occasional Advisor

name pipe

IS it possible to use name pipe in rcp, please let me know the syntax.

-bala
7 REPLIES 7
A. Clay Stephenson
Acclaimed Contributor

Re: name pipe

No because rcp (or cp) expect filenames as sources and destinations but you can use remsh:

On hostA:
mkfifo /tmp/fifo
chmod 664 /tmp/fifo
# Now let't output some command to the named pipe:
ls -l /etc > /tmp/fifo # This command will block because there is no reader process for the named pipe, yet

On hostB:
remsh hostA cat /tmp/fifo > myfile

# This will read the /tmp/fifo on the remote hostA and direct the output to the local file, myfile.
If it ain't broke, I can fix that.
Aussan
Respected Contributor

Re: name pipe

no you can't pipe with rcp
but if you are trying to tar somthing remote copy it and untar it you can try this

tar â cf â file.txt | remsh server2 'cd /src_2/dir2 ; tar â xpf â '

The tongue weighs practically nothing, but so few people can hold it
Aussan
Respected Contributor

Re: name pipe

that did not show properly
the command was

tar -cf - file.txt | remsh server2 'cd /src_2/dir2 ; tar -xpf -'
The tongue weighs practically nothing, but so few people can hold it
HartfordBala1973
Occasional Advisor

Re: name pipe

Iam planning to use diskless transfer from host-A to host-B.
1) host-A is HP tru64
2) host-B is HP ia64

I tried to use SSH as shown below using named pipe but I could not establish SSH from host A to host B.
ssh -C user@targethost 'cat > host-B/inpipe.dmp' < host-A/outpipe &


So Iam looking for using named pipe with some other command. Please advice.

-bala
A. Clay Stephenson
Acclaimed Contributor

Re: name pipe

When you mentioned rcp the last thing I expected was SSH since all the 'r' command are inherently insecure.

In any event, on most flavors of UNIX, the HP-UX command "remsh" is "rsh" but the functionality is the same so choose the one applicable to your system. The example I gave above should suffice but I would get your .rhosts file setup with a trivial command such as "remsh (or rsh) hostB ls -l /etc" before trying to do your real transfer.

If it ain't broke, I can fix that.
Aussan
Respected Contributor

Re: name pipe

what error are you getting?

is ssh on the 2 systems
The tongue weighs practically nothing, but so few people can hold it
Steven Schweda
Honored Contributor

Re: name pipe

What, exactly, whould you like to do? It's
often more helpful specify the actual problem
than it is to ask how to implement some
sub-optimal solution to that problem. Hint:
rcp and named pipes are implementation items,
not parts of the actual problem.

> I tried to use SSH [...]

Assuming that ssh will actually be part of
the solution to your problem, before trying
to use ssh to do something exotic, see if you
can get ssh to do something simple, like
"ssh other_host". Debugging a simple problem
is often easier than debugging a complex
problem.