<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Automated Share Setup in ONTAP Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Discussions/Automated-Share-Setup/m-p/446561#M42635</link>
    <description>&lt;P&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;Env: AFF-A220&lt;/P&gt;&lt;P&gt;NetApp Release 9.9.1P7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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.&amp;nbsp; Here is a clean snippet of the loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;echo "Setting up the Shares.."&lt;/P&gt;&lt;P&gt;while read -r -u 9 vserver&lt;BR /&gt;do&lt;BR /&gt;echo "Setting up Shares for $vserver"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while read -r svm share path&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; do&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sleep 3&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ssh -n stgadmin@drcluster vserver cifs share create -vserver "$svm" -share-name "$share" -path "$path"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo "done"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; done &amp;lt; testshares.txt&lt;/P&gt;&lt;P&gt;done 9&amp;lt; testsvm.txt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;Has anybody else ran into this?&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jun 2025 09:46:22 GMT</pubDate>
    <dc:creator>BobMoore</dc:creator>
    <dc:date>2025-06-04T09:46:22Z</dc:date>
    <item>
      <title>Automated Share Setup</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Automated-Share-Setup/m-p/446561#M42635</link>
      <description>&lt;P&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;Env: AFF-A220&lt;/P&gt;&lt;P&gt;NetApp Release 9.9.1P7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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.&amp;nbsp; Here is a clean snippet of the loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;echo "Setting up the Shares.."&lt;/P&gt;&lt;P&gt;while read -r -u 9 vserver&lt;BR /&gt;do&lt;BR /&gt;echo "Setting up Shares for $vserver"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while read -r svm share path&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; do&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sleep 3&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ssh -n stgadmin@drcluster vserver cifs share create -vserver "$svm" -share-name "$share" -path "$path"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo "done"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; done &amp;lt; testshares.txt&lt;/P&gt;&lt;P&gt;done 9&amp;lt; testsvm.txt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;Has anybody else ran into this?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 09:46:22 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Automated-Share-Setup/m-p/446561#M42635</guid>
      <dc:creator>BobMoore</dc:creator>
      <dc:date>2025-06-04T09:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: Automated Share Setup</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Automated-Share-Setup/m-p/446570#M42637</link>
      <description>&lt;P&gt;We figured it out!&amp;nbsp; So never mind!&lt;/P&gt;&lt;P&gt;we changed the parent while loop to a for loop and removed all the quoting in the variables for the nested loop. That did the trick!&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2023 12:58:42 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Automated-Share-Setup/m-p/446570#M42637</guid>
      <dc:creator>BobMoore</dc:creator>
      <dc:date>2023-08-02T12:58:42Z</dc:date>
    </item>
  </channel>
</rss>

