title: Shell Script split concatenate and re-use
body: <p>In Shell script I want to achieve something like below:</p>
  
  <pre><code>str="india,uk,us,uae"
  </code></pre>
  
  <p>I want to split it and concatenate each item as below and assign to some variable</p>
  
  <pre><code>newstr = '-myParam="india" -myParam="uk" -myParam="us" -myParam="uae"'
  </code></pre>
  
  <p>so that I can use above concatenated string in my next command as below</p>
  
  <pre><code>curl "admin/admin" "localhost" $newstr.
  </code></pre>
  
  <p>I found a way using local IFS and for loop but the variable updated inside loop is not retaining value outside of loop because it runs in a separate bash. </p>