#Summary rshell is a simple shell that is able to run basic syscalls utilizing: #HW3 Summary For HW3 I implemented my own version of cd, custom SIGNAL ^C,and used the execv syscall instead of the execvp syscall which required getenv() to get the PATH variable. -supports:
- cd to a directory with a relative path
- cd to a directory with an absolute path
- cd to previous (..) directory
- Special Case: cd without a directoy notifies the user there there is noe directory specified
- ^c signal is ignored in rshell when nothing is running
- ^c signal kills the child when an executable is running, such as cat
- my rshell supports commands that are located in diffrent directories by using getenv() and attempting to find the commands in multiple directories
- if the command does not exist, my rshell throws an error notifying the user that the command does not exists
#known bugs and limitations
- did not implement ^z
- STILL DOES NOT HAVE PIPING, PIPING HURTS,OH GOD
- connectors usually don't work
- io redirection does not work for ls and cd
#HW2 Summary For HW2 I implemented my own I/O Redirection symbols which requires the manipulation of file descriptors
- supports:
- executable<file #(existentfile or not)
- executable>file #(existentfile or not)
- executalbe>>file #(existentfile or not; if existent it will append)
- wctext2 #this passes text into word count and reaps the output into text2
- wc>text2 #this passes text into word count and reaps the output and appends it to text2
- CONNECTORS ARE NOT FUNCTIONING I TRIED I DID BUT MY BEST WAS NOT IN THE LEAST SUFFICENT
- PIPING DOES NOT WORK, I DEVOTED HALF MY CODE TO THEM, BUT ALAS THE SLINGS AND ARROWS OF FATE
For HW1 I implemented my own ls command. It is as close to GNU ls as possible (plus magenta "hidden" colorizing):
- supports: -a,-l,-R, and any combination of the three (i.e. -al, -lR, -Rla, and ect.)
- can take in 0,1,+1 path arguments
- uses perror on: opendir,closeddir,readdir stat
EXTRA CREDIT: uses ANSI escape codes to display diffrent types of files in color -Supports:
-
directories: blue text, BOLD
-
links: cyan text, BOLD
-
pipe: yellow text, black background
-
socket: magenta text, BOLD
-
block devices: yellow text, black background, BOLD
-
character device: yellow text, black background, BOLD
-
executables: green text
-
HIDDEN FILES: I chose to give a magenta background (instead of grey) to hidden files for readability I chose to follow the Gnu ls color coding standards
-
On invalid flag call, I report the flag that threw the error
-
return "ls: cannot run invalid flag ''"
- ./ -R
- ../ -R
- -a
- -l
- -R
- -z
- -R -R
- -R-R
- -laR
- ///////
-
- src
- src -a
- src -l
- src -R
- src -Rla
- src -l
- src/ -R
- src src
- src src -l
- src src -a
- -a src src
- -l src src
- -R src src
- -la src src
- -lR src SRC
- . src src ..
- ...
- -lll
- fakefile
- . . . . . . . . . . . . . . . . . . .
- ~
- \
- if memory takes more that 6 digit spaces, -l output becomes mis aligned
- non -a outputs are not alligned into columns
- .//
- \
- ////////
For HW0 I created rshell. rshell is a simple shell that is able to run basic syscalls utilizing
- ls and its flags, cheifly -a,-A,-l,-R,-s,-S and the sort
- echo followed by text or no text -combinational operators ';','&&','||'
- ignores white space, though flags that are touching commands are errors as per usual
- supports both "exit" and "Exit" commands
#Test Cases
- ls
- ls -a
- ls -aRl
- ls -a-R-l
- ls -a -OneFlagThatExistsAndAnotherThatDoesnt
- & ls
- ls &
- ls &&
- && ls
- ls ls ls ls ls
- ls||echo
- ls || echo
- ls && echo
- ls||&&echo
- ls|&|&|&|&echo
- ls;echo;echo
- ls;;echo
- ||
- ;
- ;&&||
- #hi
- echo # hi
- ls # -a
- ls -l ; # test
- cd #
- #echo && echo || echo test
- ls|| # test
- echo tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt#tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
- true || echo
- false || ls
- true; false||ls
- false && echo
- true && echo
- false; ls
- ls -a false
- ls true && echo
- true && false || echo wow
- false || true && wow
- ls -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- false || false || false || false || false || false || false || false || ls -l
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&& ls
- false |||||| echo
- cat nonexistantfile.cpp
- cat echo
- echo cat
- ls cat ls echo ls cat
- ls -X-x-U-V
- echo 123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789vvvvv123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789
#Known Bug
- Buffer only holds up to 32000 characters
- getting a "is not a file and directory" error on ls brings that error to other ls's
- "#" commenting doesn't work when put in a field of other characters (ex. "ttttttttttttttttttt#tttttttttttttttttt")
- ls -a-R-l throws an syntatcicall error on '-'
- cat has a simillar issue as ls when it comes to not finding and file or directory
- ls sees combinational operators as arguments on occasion
- more bugs exist that have missed my eye