title: Shell read *sometimes* strips trailing delimiter
body: <p>To parse colon-delimited fields I can use <code>read</code> with a custom <code>IFS</code>:</p>
  
  <pre><code>$ echo 'foo.c:41:switch (color) {' | { IFS=: read file line text &amp;&amp; echo "$file | $line | $text"; }
  foo.c | 41 | switch (color) {
  </code></pre>
  
  <p>If the last field contains colons, no problem, the colons are retained.</p>
  
  <pre><code>$ echo 'foo.c:42:case RED: //alert' | { IFS=: read file line text &amp;&amp; echo "$file | $line | $text"; }
  foo.c | 42 | case RED: //alert
  </code></pre>
  
  <p>A trailing delimiter is also retained...</p>
  
  <pre><code>$ echo 'foo.c:42:case RED: //alert:' | { IFS=: read file line text &amp;&amp; echo "$file | $line | $text"; }
  foo.c | 42 | case RED: //alert:
  </code></pre>
  
  <p>...Unless it's the <em>only</em> extra delimiter. Then it's stripped. <strong>Wait, what?</strong></p>
  
  <pre><code>$ echo 'foo.c:42:case RED:' | { IFS=: read file line text &amp;&amp; echo "$file | $line | $text"; }
  foo.c | 42 | case RED
  </code></pre>
  
  <p>Bash, ksh93, and dash all do this, so I'm guessing it is POSIX standard behavior.</p>
  
  <ol>
  <li>Why does it happen?</li>
  <li>What's the best alternative?</li>
  </ol>
  
  <p>I want to parse the strings above into three variables and I don't want to mangle any text in the third field. I had thought <code>read</code> was the way to go but now I'm reconsidering.</p>