This program was written to create a simple shell that could handle simple execvp commands and work similar to bash. Features include execvp commands and Connectors such as &&, ||, and ;.
ls is seperately created and supports the -l, -a, and -R flags.
- The program will prompt you with
username@machine$and wait for your input.usernameandmachinewill differ depending on account and machine you are using. E.g. if I was on my computer it would show up asandy@SlowKing$.
- Input an execvp command (e.g.
ls,pwd, orfalse) - Include any wanted flags (e.g.
-a,-l, or-r) - Press enter and rshell will run your command and prompt you for another command.
- rshell will not execute bad commands and instead print out an error message.
- When finished, type
exitinto the prompt to close it.
- After installing simply type
bin/ls - Enter files, file paths, or flags that you want
- When finished press
enter
- g++ version 4.8.2
- Clone the git repository with
git clone https://github.com/AndyThio/rshell.git - Navigate to the folder with
cd rshell - Use the
hw1branch by typinggit checkout hw1 - Check you have the Prerequisites installed
- Compile using
make - Run the program with
bin/rshellor runlswithbin/ls
- Currently a single command + flag is limited to 2048 chars (including
'\0') - When connected are entered alone, such as:
andy@SlowKing$ &&andy@SlowKing$ &&||;;;||||&&they will execute as if they were all;, but only when they are alone with no commands or arguements. This is done intentionally.- This is different from bash which returns a syntax error.
- A single
&or|will be treated the same as&&or||respectively. - A known bug is that when scripting, rshell will not be able to get your username. It will instead throw an error and display the default
unknown.
- Once a bad file is entered, ls will quit.
- Files will always be printed out in two columns. *Unless -l is used, then files are printed out in lines with static column sizes.
-lhas limitations on sizes that it can print out.- hardlinks cannot exceed 5 digits
- Usernames cannot exceed 12 characters
- Groupnames cannot exceed 8 characters
- File size cannot exceed 12 digits
bin/lscan not take more than 512 arguements.- When compiling the Makefile, it will always recompile both
rshellandls.cppto makels. - A Known bug is
makewill not work when scripting.