2016年4月28日星期四

Linux的shell中登录ssh执行命令然后退出

参考http://superuser.com/questions/808230/shell-script-ssh-to-remote-machine-then-exit-exit-does-not-work

一个例子:
#!/bin/bash
while read line
do
  echo $line
  ssh xychen@$line << HERE
    ls
HERE
done < hosts

没有评论:

发表评论