public boolean script(String line) {
    if (beeLine.getScriptOutputFile() == null) {
      return startScript(line);
    } else {
      return stopScript(line);
    }
  }
Save or stop saving a script to a file
beeline/src/java/org/apache/hive/beeline/Commands.java