无法对远程服务器gettign标语做ssh错误

时间:2018-07-12 16:20:09

标签: shell

#!/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

0 个答案:

没有答案