How to pick out/trim part of a string using Shell <p>I am trying to trim this, which is stored in a variable called $line.</p> <pre><code>[2012-06-18 10:37:09,026 (there is a lot of text after this, i just cut it out) </code></pre> <p>I am new to shell scripting and this is the code that i have</p> <pre><code>errortime= $line | cut -c2-10; </code></pre> <p>it is giving me an error, what is the correct code to pull the date out of the variable $line.</p>