title: Bash script does not output any data in tempfile
body: <p>This is the code i use, i want to collect data from 4 logfile(s) in one file, then sort it and print the temp filename.</p>
  
  <pre><code>#!/bin/bash
  
  TEMPFILE=$(mktemp)
  USER=$1
  
  # Check for input
  #if [ -z $1 ]; then echo "Give me one username or mail address please..."
  
  # Fill file with user history
  cat /var/log/messages | grep $USER &gt;&gt; $TEMPFILE
  cat /var/log/maillog | grep $USER &gt;&gt; $TEMPFILE
  zcat /var/log/messages*gz | grep $USER &gt;&gt; $TEMPFILE
  zcat /var/log/maillog*gz | grep $USER &gt;&gt; $TEMPFILE
  
  # Sort by date
  cat $TEMPFILE | sort -k1M -k2n -k3n &gt; $TEMPFILE
  
  echo $TEMPFILE
  </code></pre>