-
type "make" after cloning the repo and cding into it
-
run
./kalpesh -
external commands supported:
-
ls : lists all files not starting with .
-
-a: lists all files including those starting with . -
-1: lists each file on newline -
Corner Cases Defended
- if invalid option is passed into ls
- if too many arguments are passed into ls
-
-
mkdir : creates a directory
-
-v: verbose - informs that a directory has been created -
-p: creates parent directories as well -
Corner Cases Defended
- if an operand is missing, e.g. filename after mkdir
- if a directory cannot be created because it already exists
-
-
rm : removes a file
-
-i: prompts before removal -
-v: informs after removal -
Corner Cases Defended
- if the user tries to remove a file that does not exist
- if there is a missing operand
- if an invalid option is passed into rm
-
-
cat : prints the contents of a file
-
-n: prints line numbers -
-E: prints $ at the end of each line -
Corner Cases Defended
- if the user tries to open a file or directory that doesn't exist
- if the user passes an invalid option
-
-
date : prints the current date and time
-
-u: time in gmt -
-R: time in rfc 5322 format -
Corner Cases Defended
- invalid option
- invalid command
-
-
-
internal commands supported:
-
cd : changes the current working directory
-
-: goes to previous working directory -
-P: symbolic link components shall be resolved before dot-dot components are processed -
-L: symbolic link components shall not be resolved before dot-dot components are processed -
--help: prints help -
Corner Cases Defended
- passes an invalid option
- passes an invalid number of arguments
-
-
pwd : prints the current working directory
-
-L: follow symlinks -
-P: dont follow symlinks -
Corner Cases Defended
- cannot read current directory
- invalid option
-
-
echo : prints the arguments passed to it
-
--help: print help -
-n: removes newline -
Corner Cases Defended
- invalid option
- invalid command
-
-
exit :
- exits the shell
-
- used fork() and exec() calls
- fork() creates a new process by copying the current running one
- exec() replaces the new, child process with the required process
- pthread_create() creates a new thread to run the command
- the command needs to be of the form "command&t -option"
- for example, "ls&t -1"