Parse configuration remote configuration file
<p>I want to read in a remote configuration file in a bash script; locally the following works fine:</p>

<pre><code>while IFS="=" read -r name value; do
    declare "$name=$value"
done &lt; "$cfg"
</code></pre>

<p>I tried to do the same using <code>ssh</code> and <code>cat</code>:</p>

<pre><code>ssh "$hostname" "cat $remote_cfg" |
while IFS="=" read -r name value; do
    declare "$name=$value"
    echo $name $value
done
</code></pre>

<p>But my variables are only declared in scope of the while loop, how can I bring them to the outer scope?</p>

<p>Thanks in advance!</p>