title: sed + removes all leading and trailing whitespace from each line on solaris system
body: <p>I have a Solaris machine  (SunOSsu1a 5.10 Generic_142900-15 sun 4vsparcSUNW,Netra-T2000).</p>
  
  <p>The following sed syntax removes all leading and trailing whitespace from each line (I need to remove whitespace because it causes application problems).</p>
  
  <pre><code>        sed 's/^[ \t]*//;s/[ \t]*$//' orig_file &gt; new_file
  </code></pre>
  
  <p>But I noticed that sed also removes the "t" character from the end of each line.</p>
  
  <p>Please advise how to fix the sed syntax/command in order to remove only the leading and trailing whitespace from each line  (the solution can be also with Perl or AWK).</p>
  
  <p>Examples (take a look at the last string - set_host)</p>
  
  <p>1) </p>
  
  <p>Original line before running sed command</p>
  
  <pre><code>   pack/configuration/param[14]/action:set_host
  </code></pre>
  
  <p>another example (before I run sed)</p>
  
  <pre><code>   +/etc/cp/config/Network-Configuration/Network-Configuration.xml:/cp-pack/configuration/param[8]/action:set_host
  </code></pre>
  
  <p>2)</p>
  
  <p>the line after I run the sed command </p>
  
  <pre><code>   pack/configuration/param[14]/action:set_hos
  </code></pre>
  
  <p>another example (after I run sed)</p>
  
  <pre><code>   +/etc/cp/config/Network-Configuration/Network-Configuration.xml:/cp-pack/configuration/param[8]/action:set_hos
  </code></pre>