rget.1

来自「minix操作系统最新版本(3.1.1)的源代码」· 1 代码 · 共 170 行

1
170
字号
.TH RGET 1.SH NAMErget, rput \- network pipe.SH SYNOPSIS.B rget.RB [ \-lcio ].RB [ \-h.IR host ].I key.RI [ command.RI [ arg " ...]]".br.B rput.RB [ \-lcio ].RB [ \-h.IR host ].I key.RI [ command.RI [ arg " ...]]".SH DESCRIPTION.de SP.if t .sp 0.4.if n .sp...de XS	\" Example start.SP.in +4m.nf...de XE	\" Example end.fi.in -4m.SP...B Rputand.B rgetset up a TCP/IP channel to connect two processes together.  They can lookedupon as a remote pipe.  Consider the well known method of copying adirectory tree with.BR tar :.XS(cd src && tar cf \- .) | (cd dst && tar xfp \-).XEIf the directory tree is to be copied to another machine then one canuse the following command on the source machine:.XScd src && rput foo tar cf \- ..XEAnd on the destination machine:.XScd dst && rget \-h \fIsource-machine\fP foo tar xfp \-.XEThe.I keyis either a port number in C style decimal, octal or hex, or a random stringthat is hashed to a port number..B Rputuses this port number to open a TCP socket that.B rgetusing the same.I keycan connect to.It is customary to start.B rputfirst, although.B rgetwill retry for 2 minutes trying to connect to the remote.BR rput..PPAfter the connection is established either utility will execute.I commandwith the given arguments with the TCP channel as either standard output(rput) or standard input (rget)..B Rputand.B rgetdo not stay around for the command to finish, they simply overlay themselveswith the command.  If no command is given then they will themselves copystandard input into the TCP channel (rput), or output from the TCP channelto standard output (rget).  So these two commands have the same effect:.XSrput foo tar cf \- .tar cf \- . | rput foo.XEThe second form has two processes copying data instead of just.B tardirectly writing its output into the TCP channel.  There is a better way towaste processor cycles, namely to save bandwidth:.XScd src && tar cf \- . | rput foo compress.SPcd dst && rget \-h \fIsource-machine\fP foo uncompress | tar xfp \-.XE.B Rputand.B rgetcan be very useful in the windowed environments we use these days.  The.B rputcan be typed into the window that has a shell running on one machine, andthe.B rgetis then typed into the window that has a shell running on another machine.This is easier than one of the two well known forms that use.BR rsh :.XScd src && tar cf \- . | rsh dest-machine "cd dst && tar xfp \-".SPcd dst && rsh source-machine "cd src && tar cf \- ." | tar xfp \-.XEEspecially since these forms require that one must be able to use.B rshwithout a password, which may not always be the case..PPThe.I keycan be any string of characters of any length.  If its a number then it isused directly as the port number.  Otherwise the characters binary valuesare multiplied together, bit 15 is set and the result is truncated to 16bits to make it a port number in the anonymous port space (32768 \- 65535).The port may be in-use on the source machine, but there is a small chanceof this happening, and if so simply choose another key.  (So if you use.B rputand.B rgetin an unattended script then you should reserve a port number, otherwisea connection can't be guaranteed.).SH OPTIONS.TP.B \-lcioThese flags allow one to reverse the default connect/listen or input/outputdirection of.BR rputand.BR rget .Reversing the connection may be necessary if one of the two systems filtersout connections to unknown ports.  For example:.XSrput \-c \-h \fIdestination-machine\fP foo tar cf \- ..SPrget \-l foo tar xfp \-.XEThe.B \-iooptions can be used to choose which of standard input or output should betied to the socket.  It's even possible to tie both input and output to thesocket with.BR \-io,but only when executing a command.  This is probably the only use for theseoptions, because one usually chooses the direction with the mnemonic put/getnames..TP.BI \-h " host"The name of the remote host that a connection must be made to.  It must beused with the program that is doing the connect, usually.BR rget .This option is currently mandatory.  The author is planning to increaseease of use by letting the programs find each other with UDP broadcastsor multicasts..SH "SEE ALSO".BR rsh (1)..SH DIAGNOSTICS.TP 5rput: Address in useIf the port computed out of.I keyis already in use..SH AUTHORKees J. Bot <kjb@cs.vu.nl>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?