想要创建一个脚本来使用 for 循环从远程服务器的特定路径中 grep 特定单词

想要创建一个脚本来使用 for 循环从远程服务器的特定路径中 grep 特定单词
#!/bin/ksh
# set array called nameservers
set -A qaservers l8sita01 l4sita06 l4dvidap2256 l98vidap2256

print -n "\nEnter the Client ID :"
read clientID 

# print all name servers
for i in ${qaservers[@]}
do


ssh "uname -a; grep jms/erms/$clientID /apps/WebSphere/NA70_TBA/config/cells/CellV70_TBA/resources.xml;"

done

错误

ssh: uname -a; grep jms/erms/1212 /apps/WebSphere/NA70_TBA/config/cells/CellV70_TBA/resources.xml;: non-recoverable name resolution failure
ssh: uname -a; grep jms/erms/1212 /apps/WebSphere/NA70_TBA/config/cells/CellV70_TBA/resources.xml;: non-recoverable name resolution failure
ssh: uname -a; grep jms/erms/1212 /apps/WebSphere/NA70_TBA/config/cells/CellV70_TBA/resources.xml;: non-recoverable name resolution failure
ssh: uname -a; grep jms/erms/1212 /apps/WebSphere/NA70_TBA/config/cells/CellV70_TBA/resources.xml;: non-recoverable name resolution failure

答案1

尝试在 ssh 命令中传递 IP/主机名,希望您提供那些使用for循环的内容。

 ssh "$i" "uname -a;......"

相关内容