make
./mysh
movetodir <dir>
- change directory- ex:
movetodir /home/mykola/projects/OS/mysh
- ex:
movetodir ../../projects/OS/homework/
- ex:
history [-c]
- command history.-c
to clear- ex:
history -c
- ex:
run program [parameters]
- run a program in foreground- ex:
run /usr/bin/xterm -bg green
- ex:
run ls -l
- ex:
background program [parameters]
- run a program in background- ex:
background /usr/bin/xterm -bg green
- ex:
repeat n command
- repeat specified command n times- ex:
repeat 5 /usr/bin/xterm -ng red
- ex:
exterminate <PID>
- kill process with PID- ex:
exterminate 16010
- ex:
exterminateall
- kill all background processeswhereami
- print current working directorybyebye
- terminate the shell
Written as a homework for COP4600. I spent a little too much time organizing the system architecture and planning for extensibility before realized that at this rate the code will be three thousand lines long. So I went for a more limited, but stable implementation.
I utilized something that resembles the Command pattern from This amazing Game design patterns book.
Tested with g++ 9.3.0 on Ubuntu 20