RShell is meant to be a basic implementation of the Bash shell written in C++. Utilizing the execvp function RShell can execute commands found in /bin.
git clone https://github.com/aorti017/rshell.gitcd rshellmakebin/rshellorbin/ls
- Multiple commands can be stringed together on a single line by using the
&&,||, or;connectors. - Connecting multiple commands by
&&will cause commands to execute only if the command prior was successful. - Connecting multiple commands by
||will cause commands to execute only if the command prior was not successful. - Connecting multiple commands by
;will cause command to execute regardless of if the prior command was successful. - Using more than one type of connector per line will result in a
Multiple connector types forbiddenerror message. - Excess connectors inserted in the front of a command line, in between commands, or at the end of a command line will be ignored.
- Comments can be inserted using
#, anything after#will be interpreted as a comment. - The
exitcommand will exit RShell upon execution. - The
cpcommand can be used to copy the contents of a source file into a destination file. cpcan be used with the-aflag, which will copy using all methods. If no flag is specified it will be copied using the fastest method.cpwill output an error if the destination file already exists, or if either the source or destination are directories.- The
bin/lscommand can be used with any combination of, or none of, the optional flags-a,-l, or-R. -adisplays all files including those that are hidden.-ldisplays all of the information associated with a file.-Rrecursively outputs the contents of all the directories in the starting directory.- When using the
bin/lscommand directories are displayed in blue, executables in green, and hidden files with a grey background. - Input and output can be redirected using
<,>, and>>. - Multiple consecutive instances of
<will only input the last file. - Multiple consecutive instances of
>or>>will clear all files then output to the last one. - Strings can be passed to commands via redirection using
<<<. - Filed descriptors can be specified before the output operator
>, such as1>. When doing this there must be a space between the command and the file descriptor. - Commands and redirections can be piped using
|. - Commands beginning with the
|, or any other redirector, character will result in an error. - The
cdcommand can be used to change the current working directory, which will be displayed in the prompt. - The
cdcommand can take 0 to 1 parameters, any more than 1 will be ignored. - The
^Csignal can be used to kill the current foreground process. - If there is no current foreground porccess the
^Csignal will do nothing.
- Does not support the functionality of quotation marks with commands like
echo. - Using connectors as part of or the parameter for a command may cause the command to not execute properly, if at all.
- When using
&&connectors if any extra (more than 1) of these connectors are inserted in between any two commands, or in the front of the command line, and any of the said extra connectors are separated by a space any command after the excess connectors will not execute. &is interpreted as&&.bin/lscan not be used with regular expressions.- When passing a hidden file to
bin/lsthe background is not colored grey. - When running
catwith string redirection, the string is output with no new line. - If using a custom file descriptor and the file descriptor is bad nothing will be output to either file or stdout.
- If the file
filehas contents and the commandcat<file>>fileis executed an infinite loop will occur. - Can not link together piping operations using connectors.
2>and2>>can not combined with pipes.cdis not compatible with regular expressions.- If an executable cannot be found in any of the
PATHdirectories, it can be run without the./prefix. - If an input command does not exist there will be a possible memory leak.