请教:rsh命令在远端执行的返回结果如何写入到本地文件?
例如
rsh remoteserver echo /etc/hosts >> /var/test.log
这样写入的是远端的test.log还是本地的test.log
如果是远端的,如何写入本地?
谢谢
[解决办法]
rsh remoteserver echo /etc/hosts >> /var/test.log
写入本地
rsh remoteserver "echo /etc/hosts >> /var/test.log"
写入远端
[解决办法]
我刚刚man了一把rsh,下面的描述很有意思:
$man rsh
....
The following command appends the file lizard.file on the
machine called lizard to the file lizard.file2 which also
resides on the machine called lizard:
example% rsh lizard cat lizard.file ">>" lizard.file2
....
[解决办法]
SSH(1) BSD General Commands Manual SSH(1)
NAME
ssh - OpenSSH SSH client (remote login program)
SYNOPSIS
ssh [-1246AaCfgKkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec] [-D [bind_address:]port] [-e escape_char]
[-F configfile] [-i identity_file] [-L [bind_address:]port:host:hostport] [-l login_name] [-m mac_spec]
[-O ctl_cmd] [-o option] [-p port] [-R [bind_address:]port:host:hostport] [-S ctl_path]
[-w local_tun[:remote_tun]] [user@]hostname [command]
DESCRIPTION
ssh (SSH client) is a program for logging into a remote machine and for executing commands on a remote machine. It
is intended to replace rlogin and rsh, and provide secure encrypted communications between two untrusted hosts over
an insecure network. X11 connections and arbitrary TCP ports can also be forwarded over the secure channel.
ssh connects and logs into the specified hostname (with optional user name). The user must prove his/her identity
to the remote machine using one of several methods depending on the protocol version used (see below).
If command is specified, it is executed on the remote host instead of a login shell.
The options are as follows:
-1 Forces ssh to try protocol version 1 only.
-2 Forces ssh to try protocol version 2 only.
-4 Forces ssh to use IPv4 addresses only.
-6 Forces ssh to use IPv6 addresses only.
[解决办法]
man girl
No manual entry for girl