title: Sort is not working from inside bash script
body: <p>I am using a bash script to retrieve data in CSV-style from a database, I <strong>sort</strong> it and put into an external file. </p>
  
  <p>Everything seems to be correct, but <strong>sort</strong> (<em>sort (GNU coreutils) 8.26</em>) is not sorting the rows. </p>
  
  <p>That is my bash script: </p>
  
  <pre><code>#!/bin/bash
  mongoexport --type=csv ${QUERY} | /usr/bin/sort &gt; export.csv
  </code></pre>
  
  <p>The content of export.csv remains the same as the original mongoexport-output - it's still unsorted. </p>
  
  <p>The confusing thing is: When I run this command directly from the command line, sort does what it's supposed to do: It sorts the lines. </p>
  
  <p>What I am doing wrong? </p>