Pipe out a substring by removing the last N characters
<p>How can I pipe a string and drop a few characters off it?, e.g:</p>

<pre><code>$ echo forbes | ... -3
for
$ echo cucumber | ... -4
cucu
$ echo 1461624333 | .. -3 
1461624
...
etc.
</code></pre>

<p>I couldn't find way to use <code>${str:0:-3}</code> syntax in a pipe.</p>