title: Can't run java in bashscript
body: <p>I am trying to write a bash script that simply compiles a java file then runs it</p>
  
  <pre><code>#!/bin/bash
  read name
  javac $name
  $name | sed -r "s/.java//" | java
  </code></pre>
  
  <p>but instead of running the java file, it opens java.</p>
  
  <pre><code>Usage: java [-options] class [args...]
             (to execute a class)
     or  java [-options] -jar jarfile [args...]
             (to execute a jar file)
  
         blah blah blah
  </code></pre>