title: How to remove trailing whitespaces with sed?
body: <p>I have a simple shell script that removes trailing whitespace from a file. Is there any way to make this script more compact (without creating a temporary file)?</p>
  
  <pre><code>sed 's/[ \t]*$//' $1 &gt; $1__.tmp
  cat $1__.tmp &gt; $1
  rm $1__.tmp
  </code></pre>