首页 > 解决方案 > 无法对远程服务器执行 ssh gettign 横幅错误

问题描述

#!/bin/bash


FILE="${1}"
while read line; do

REMOTESERVER=`echo ${line} | cut -d"," -f1`
REMOTEUSER=`echo ${line} | cut -d"," -f2`
REMOTEPASS=`echo ${line} | cut -d"," -f3`
DBUSER=`echo ${line} | cut -d"," -f4`
DBPASS=`echo ${line} | cut -d"," -f5`
DBNAME=`echo ${line} | cut -d"," -f6`

output=`sshpass -p \'$REMOTEPASS\' ssh -o StrictHostKeyChecking=no -T $REMOTEUSER@$REMOTESERVER
sleep 5

sqlplus -s "$DBUSER/$DBPASS@$DBNAME " <<EOF
set heading off feedback off verify off
         select Instance_name,host_name,version,startup_time,status from v\\$instance;
           exit
EOF

echo $output >> dboutput.txt

标签: shell

解决方案


推荐阅读