更改完系统语言之后能做到不重启不注销就能显示更改之后的效果吗?
2
knightdf 2016-11-22 13:06:27 +08:00
在脚本中 echo/print 出来就行了
例子: > ssh [email protected] "ping v2ex.com" >> test 2>&1 > cat test > PING v2ex.com (14.152.44.135) 56(84) bytes of data. 64 bytes from 14.152.44.135: icmp_seq=1 ttl=52 time=21.3 ms 64 bytes from 14.152.44.135: icmp_seq=2 ttl=52 time=21.3 ms 64 bytes from 14.152.44.135: icmp_seq=3 ttl=52 time=21.2 ms 64 bytes from 14.152.44.135: icmp_seq=4 ttl=52 time=21.4 ms 64 bytes from 14.152.44.135: icmp_seq=5 ttl=52 time=21.2 ms 64 bytes from 14.152.44.135: icmp_seq=6 ttl=52 time=27.7 ms 64 bytes from 14.152.44.135: icmp_seq=7 ttl=52 time=20.3 ms 64 bytes from 14.152.44.135: icmp_seq=8 ttl=52 time=20.5 ms 64 bytes from 14.152.44.135: icmp_seq=9 ttl=52 time=20.4 ms 64 bytes from 14.152.44.135: icmp_seq=10 ttl=52 time=20.2 ms --- v2ex.com ping statistics --- 10 packets transmitted, 10 received, 0% packet loss, time 9030ms rtt min/avg/max/mdev = 20.279/21.586/27.712/2.086 ms |
5
ceyes 2016-11-22 13:56:14 +08:00 1
tips
1. 可以用 ssh-copy-id 将本机的公钥拷贝到远程机器的 authorized_keys 文件中,实现无密码登录。可以在部署的时候就把公钥都装好,或用 tcl/expect 先完成公钥拷贝。 2. ssh LinuxB 后面可以直接跟命令,远端的执行的结果就在 A 的标准输出上, ssh 的返回值就是远端的命令返回值。 3. 还可以设置一个 NFS ,在 LinuxB 上 mount 作为 worksace ,执行脚本和 log 都在这个 workspace 中。 |
7
ceyes 2016-11-22 15:26:50 +08:00
@Alain1995 ssh <user>@<IP_of_LinuxB> exit && echo "have key" || echo "no key"
|
8
gihnius 2016-11-22 20:50:11 +08:00
linux_A $ ssh you@linux_B 'bash -s' < your_local_script_on_A.sh sh-args...
|