rshell is a simple shell created for a class at school
Run the folling commands in the location in which you would like to install rshell
$ git clone https://github.com/srufe001/rshell.git
$ cd rshell
$ make
You can now run rshell by typing bin/rshell
into the command prompt
$ pwd
$ ls -a
$ ./my_executable
Type exit
to exit rshell
$ exit
rshell supports the connectors &&
, ||
, and ;
.
&&
executes the following command only if the previous command ran
successfully,
||
executes the following command only if the previous command ran unsuccessfully,
and ;
runs the following command regardless of what the previous command returned.
$ pwd && ls # this will execute pwd and ls
$ false || echo Hello World # this print Hello World
$ mkdir myDir ; ls # this will run both commands, one after another
No command is considered a success, and a command that does not exist is considered a failure:
$ && echo Hi # this will print Hi
$ ;; echo Hi # this will also print Hi
$ notacommand && echo Hi # this will NOT print Hi
Any characters following a #
are ignored by the shell
$ echo this will be printed # but this will not
If a command fails to execute (the fork() syscall fails), rshell will cancel the execution of the rest of the command, print an error message, and print another prompt. if the wait() syscall fails, rshell will exit.
- built-in commands like
cd
are not yet implemented - other popular features of shells like bash (pipes, input/output redirection, quoted string) are not implemented in rshell
- rshell does not print very helpful error messages when the user makes a syntax error.