runfile .bashrc getline if starts with . look for semi if found split runit(first) runit(second) else runit(whole) if "|" pipe fork if (one) close runit(first, pipe[0]) else close runit(second, pipe[1]) exit function runfile open file read each line do the stuff below on that line function runit { c++ stringy stuff -or- int count = sscanf(input, "%s %s %s %s %s %s %s %s %s", argv[0], argv[1], argv[2], argv[3]... for each arg if it has * or ? glob else if starts with $ replace with getenv of that argv[count] = 0; if starts with "cd" chdir argv[1] return for each item in argv if its a ">" remove that one and the next store next into outputfilename fork if (kid) if outputfilename open dup for each dir in path exec dir+/+name exit } getline ls & ls ls | wc ls > fred -l -t /home < /steve ls -l -t /home getenv exec("/bin/ls", "/bin/ls", "-l", 0); argv[0] = "/bin/ls"; argv[1] = "-l"; argv[2] = 0; exec("/bin/ls", argv);