unexpected EOF while looking for matching `'' while using sed <p>Yes this question has been asked many times, and in the answer it is said to us <code>\</code> escape character before the single quote.</p> <p>In the below code it isn't working:</p> <pre><code>LIST="(96634,IV14075295,TR14075685')" LIST=`echo $LIST | sed 's/,/AAA/g' ` echo $LIST # Output: (96634AAAIV14075295AAATR14075685') # Now i want to quote the list elements LIST=`echo $LIST | sed 's/,/\',\'/g' ` # Giving error # exit 0 </code></pre> <p><strong>Error :</strong></p> <pre><code>line 7: unexpected EOF while looking for matching `'' line 8: syntax error: unexpected end of file </code></pre>