code for unix shell emulator