private boolean sourceFileInternal(File sourceFile) throws IOException {
    BufferedReader reader = null;
    try {
      reader = new BufferedReader(new FileReader(sourceFile));
      String lines = null, extra;
      while ((extra = reader.readLine()) != null) {
        if (beeLine.isComment(extra)) {
          continue;
        }
        if (lines == null) {
          lines = extra;
        } else {
          lines += "\n" + extra;
        }
      }
      String[] cmds = lines.split(beeLine.getOpts().getDelimiter());
      for (String c : cmds) {
        c = c.trim();
        if (!executeInternal(c, false)) {
          return false;
        }
      }
    } finally {
      if (reader != null) {
        reader.close();
      }
    }
    return true;
  }
Extract and clean up the first command in the input.
beeline/src/java/org/apache/hive/beeline/Commands.java