作者:好人langren_840 | 来源:互联网 | 2023-06-16 16:51
IamtryingtodosomethingsimpleinbashbutIcannotgetittowork.Ihavedefinedthevariable:
I am trying to do something simple in bash but I cannot get it to work. I have defined the variable:
我试图在bash中做一些简单的事情,但我无法让它工作。我已定义变量:
export devcluster2="10.122.22.22"
in my .bashrc. When I type:
在我的.bashrc中。当我输入:
echo $devcluster2
I get as expected:
echo $ devcluster2我按预期得到:
10.122.22.22
now I want to do:
现在我想做:
echo '$devcluster2' | ssh
but I get
但我明白了
usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-e escape_char] [-F configfile]
[-I pkcs11] [-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 host:port] [-w local_tun[:remote_tun]]
[user@]hostname [command]
I want to understand why the ssh
doesn't get the output of echo as an input? and how can I get it to work?
我想了解为什么ssh没有将echo的输出作为输入?我怎样才能让它发挥作用?
1 个解决方案