@@ -0,0 +1,2508 @@
+package data_struct.proj.pX.edterm;%0A%0Aimport java.io.File;%0Aimport java.util.ArrayList;%0Aimport java.util.Scanner;%0A%0A/**%0A * This is a functioning terminal program. Theoretically.%0A * %0A * @author Eddie Gurnee%0A * @version 0.0.01 11/19/2013%0A * @since 11/19/2013%0A */%0Apublic class EdTerm %7B%0A    private final static String USER = System.getProperty(%22user.name%22);%0A%0A    // private%0A    public static void main(String%5B%5D args) %7B%0A        Scanner kb = new Scanner(System.in);%0A        File pwd = new File(System.getProperty(%22user.home%22));%0A        ArrayList%3CString%3E history = new ArrayList%3C%3E();%0A%0A        enterCmd: while (true) %7B%0A            System.out.print(pwd.getName() + %22: %22 + USER + %22$: %22);%0A            String cmdLine = kb.nextLine().trim();%0A            if (!cmdLine.isEmpty()) %7B%0A                history.add(cmdLine);%0A                Scanner cmd = new Scanner(cmdLine);%0A                String theCMD = cmd.next().toLowerCase();%0A                switch (theCMD) %7B%0A                case %22pwd%22:%0A                    System.out.println(pwd.getAbsolutePath());%0A                    break;%0A                case %22open%22:%0A%0A                    break;%0A                case %22cd%22:%0A                    if (cmd.hasNext()) %7B%0A                        String dir = cmd.next();%0A                        if (dir.equals(%22../%22)) %7B%0A                            pwd = pwd.getParentFile();%0A                        %7D else if (new File(pwd, dir).exists()) %7B%0A                            pwd = new File(pwd, dir);%0A                        %7D else %7B%0A                            System.out.println(%22No such file or directory%22);%0A                        %7D%0A                    %7D%0A                    break;%0A                case %22ls%22:%0A                    if (pwd.list().length != 0) %7B%0A                        for (File s : pwd.listFiles()) %7B%0A                            if (!s.isHidden()) %7B%0A                                System.out.println(s);%0A                            %7D%0A                        %7D%0A                    %7D%0A                    break;%0A                case %22history%22:%0A                    for (String s : history) %7B%0A                        System.out.println(s);%0A                    %7D%0A                    break;%0A                case %22exit%22:%0A                    cmd.close();%0A                    break enterCmd;%0A                default:%0A                    System.out.println(theCMD + %22: command not found%22);%0A                    break;%0A                %7D%0A            %7D%0A        %7D%0A        System.out.println(%22EdTerm Terminated.%22);%0A        kb.close();%0A    %7D%0A%7D%0A

add edterm