title: using sed to find and replace in bash for loop
body: <p>I have a large number of words in a text file to replace.</p>
  
  <p>This script is working up until the sed command where I get:</p>
  
  <blockquote>
    <p>sed: 1: "*.js": invalid command code *</p>
  </blockquote>
  
  <p>PS... Bash isn't one of my strong points - this doesn't need to be pretty or efficient</p>
  
  <pre><code>cd '/Users/xxxxxx/Sites/xxxxxx'
      echo `pwd`;
  
      for line in `cat myFile.txt`
      do
          export IFS=":"
          i=0
          list=()
  
          for word in $line; do
              list[$i]=$word
              i=$[i+1]
          done
  
          echo ${list[0]}
          echo ${list[1]}
  
          sed -i "s/{$list[0]}/{$list[1]}/g" *.js
  
      done
  </code></pre>