This project is a simple command shell that reads in user-input commands on one line and work similarly to the bash shell. It is a project for CS100: Software Construction at UC Riverside, taught by Mike Izbicki.
Clone this project at: https://github.com/shawnjzlee/rshell.git.
Once cloned, enter a shell and type cd rshell to enter the project directory.
-
Type
maketo compilershell.cppandls.cppand place the executables in the./binfolder, which will be created by Makefile.- Type
make rshellto compile and placershellin the./binfolder - Type
make lsto compile and placelsin the./binfolder
- Type
-
Running the executable using your existing shell will prompt you with
username@hostname$and wait for an input -
Press enter after typing in a command, its flags, etc.
- Typing
exitwill close the executable.
- Typing
- Type
debug-rshellto enable the-gflag for debuggingrshell - Type
debug-lsto enable the-gflag for debuggingls
###rshell
;connector does not work as intended. Even though multiple commands linked together should execute, only the first command before the;executes.[FIX 0.01 (02/02/15)] All connectors are working as intended
cdproduces an error because it is not built into the bash command- When scripting on Ubuntu 14.04, rshell will not be able to get username. It will instead throw an error and use default
guestas its username. - Multiple
&&and||connectors does not work as intended because connectors and their logic (as well as precedence) are not implemented correctly; however, single uses of these connectors work as intended.[FIX 0.01 (02/02/15)] See FIX 0.01
exitdoes not work on a line with multiple commands.exitalone will work; however,ls; exitwill not.[FIX 0.01 (02/02/15)] See FIX 0.01
- rshell does not work with infinitely large commands
mkdir testcreates a folder as intended; however,mkdir test#folderwill treatfolderas a comment and create a folder namedtest.touch testcreates a file as intended; however,touch test#filewill treatfileas a comment and create a file namedtest.
###ls
-Ris incomplete. It acts like-aand can be combined with other flags for similar results (except total number of blocks allocated).- Unless in a directory with all files of hard links
1, total number of allocated blocks displayed is incorrect. lswill not allow directories to be passed in to output its files; however, if files are passed in, it will output those files if they exist.ls -aoutputs up to 64 characters per line, for better readability in console.lscannot access directories before and after it because it cannot recognize the location.
###io redirection
>,>>and<work as long as there are spaces on the between arguments.|outputs what is passed in through redirection, but does not work withgrepand similar commands
###signals and changing directory
- calling a shell within a shell, as well as
g++, does not work cd,ls,cat,pwd,echowork within rshell