title: Bash script function return value problem
body: <p>Can anyone help me return the correct value from a bash script function?</p>
  
  <p>Here's my function that should return first (and only) line of the file passed as an argument:</p>
  
  <pre><code>LOG_FILE_CREATION_TIME()
  {
      return_value=`awk 'NR==1' $1`
      return return_value
  }
  </code></pre>
  
  <p>And here's my call of that function in the other script:</p>
  
  <pre><code>LOG_FILE_CREATION_TIME "logfile"
  timestamp=$?
  echo "Timestamp = $timestamp"
  </code></pre>
  
  <p>I always get some random values with this code. If, for example, there's a value of 62772031 in the "logfile", I get </p>
  
  <blockquote>
    <p>Timestamp = 255</p>
  </blockquote>
  
  <p>as an output. For some other values in the file, I get other random values as a return value, never the correct one.</p>
  
  <p>Any ideas?</p>