public void run() {  final String cmdLine = (String) AccessController .doPrivileged(new GetPropertyAction("jnode.cmdline", "")); final StringTokenizer tok = new StringTokenizer(cmdLine); while (tok.hasMoreTokens()) { final String e = tok.nextToken(); try { if (e.startsWith("cmd=")) { final String cmd = e.substring("cmd=".length()); currentPrompt = prompt(); out.println(currentPrompt + cmd); processCommand(cmd); } } catch (Throwable ex) { ex.printStackTrace(err); }
public void run() {  final String cmdLine = (String) AccessController .doPrivileged(new GetPropertyAction("jnode.cmdline", "")); final StringTokenizer tok = new StringTokenizer(cmdLine);  while (tok.hasMoreTokens()) { final String e = tok.nextToken(); try { if (e.startsWith(command)) { final String cmd = e.substring(command.length()); currentPrompt = prompt(); out.println(currentPrompt + cmd); processCommand(cmd); } } catch (Throwable ex) { ex.printStackTrace(err); } }   boolean halt = false; while (!halt) { try { synchronized (this) {  isActive = true; currentPrompt = prompt(); out.print(currentPrompt); currentLine.start();   threadSuspended = true; while (threadSuspended) { wait(); }  String line = currentLine.getContent().trim(); if (line.length() > 0) { processCommand(line); }  if (VmSystem.isShuttingDown()) { halt = true; }   historyIndex = -1;
    public void run() {        // Run commands from the JNode commandline first        final String cmdLine = (String) AccessController                .doPrivileged(new GetPropertyAction("jnode.cmdline", ""));        final StringTokenizer tok = new StringTokenizer(cmdLine);        while (tok.hasMoreTokens()) {            final String e = tok.nextToken();            try {                if (e.startsWith("cmd=")) {                    final String cmd = e.substring("cmd=".length());                    currentPrompt = prompt();                    out.println(currentPrompt + cmd);                    processCommand(cmd);                }            } catch (Throwable ex) {                ex.printStackTrace(err);            }        }        // Now become interactive        boolean halt = false;        while (!halt) {            try {                synchronized (this) {                    //  Catch keyboard events                    isActive = true;                    currentPrompt = prompt();                    out.print(currentPrompt);                    currentLine.start();                                        //  wait until enter is hit                    threadSuspended = true;                    while (threadSuspended) {                        wait();                    }                                        String line = currentLine.getContent().trim();                    if (line.length() > 0) {                        processCommand(line);                    }                    if (VmSystem.isShuttingDown()) {                        halt = true;                    }                    //if (currentLine.trim().equals("halt")) halt = true;                    historyIndex = -1;                }            } catch (Throwable ex) {                ex.printStackTrace(err);            }        }    }