Hi everyone!
Env: AFF-A220
NetApp Release 9.9.1P7
I'm trying to write an automation script that breaks replication between two sites and then sets up shares in the DR site. I have the snapmirror break portion working just fine. What i need help with is a nested loop that sets up the shares.
What it's supposed to do is loop through a list of SVM's and run the share create command on each one. The issue is the variables are being lost within the nested while loop. If i pull them out of a nested loop, it works. It has something to do with how ssh is handling them, but for the life of me i can't figure out why it's stripping the variable values. Here is a clean snippet of the loop.
echo "Setting up the Shares.."
while read -r -u 9 vserver
do
echo "Setting up Shares for $vserver"
while read -r svm share path
do
sleep 3
ssh -n stgadmin@drcluster vserver cifs share create -vserver "$svm" -share-name "$share" -path "$path"
echo "done"
done < testshares.txt
done 9< testsvm.txt
I've already tried ALL the different combinations of quotes, single, double, back tics, back slashes, and single quotes inside double quotes. Nothing seems to work. ssh keeps stripping the variable value when it hits the netapp.
Has anybody else ran into this?