title: How do you load a file into racket via command line?
body: <p>I have been trying to launch a racket program from the commandline (via 'racket') but have not been having success. According to the documentation (here <a href="http://docs.racket-lang.org/reference/running-sa.html#%28part._mz-cmdline%29" rel="noreferrer">http://docs.racket-lang.org/reference/running-sa.html#%28part._mz-cmdline%29</a>) passing <code>-f</code> followed by a file should evaluate that file. However, I can't seem to get this to work. As a test, I made the following file:</p>
  
  <pre><code>;test.rkt
  #lang racket
  (define a 1)
  </code></pre>
  
  <p>Then, running it in racket (supposedly loading the file) and attempting to recall the value of a:</p>
  
  <pre><code>racket -f test.rkt -i
  Welcome to Racket v5.1.1.
  &gt; a
  reference to undefined identifier: a
  </code></pre>
  
  <p>My end goal is to be able to launch a different program from a shell script using the <code>--main</code> option combined with loading the definitions with <code>-f</code> to start up execution, just have become a bit baffled since I can't seem to get this trivial bit working.</p>