title: Using sed to insert text at end of line matching string
body: <p>I have a line in a text file containing a list of items assigned to a variable ...</p>
  
  <pre><code>ITEMS="$ITEM1 $ITEM2 $ITEM3"
  </code></pre>
  
  <p>And I would like write a bash script that uses sed to find the line matching ITEMS and append another item to the end of the list within the double quotes, so it results in ...</p>
  
  <pre><code>ITEMS="$ITEM1 $ITEM2 $ITEM3 $ITEM4"
  </code></pre>
  
  <p>Furthermore, I have the number of the item to add stored in a variable, let's say it's $number.  So I'm trying to get it to add $ITEM4$number and have it replace $number with whatever I assigned to that variable, let's say it's the number 4 in this case.  How could I best accomplish this?  Thanks!</p>