execute the given command to create an executable file
make
Now run
./shell.out
This command is made using chdir whereas egde cases like
cd - is taken care by storing OLD PWD
cd ~/dir is taken by manipulating strings
This is used to display the prompt
This is used to do echo using string manipulation and printf
It contains global varibale that will be used by different c files and contains headers for all files
- void readfromhistory(); to read from history.txt only to be used in the begining
- void writetohistory(); to write to history.txt it is executed after exit is enetered by user
- void commandhistory(int number); to implement history command , displays the name of recent commands based upon arguments
This is used to take care of all the commands that are not implemented by me
Uses fork and execvp to execute things in child process
Parent waits for foreground
This contains function that are executed on singly linked list this linked list conatins process id and process command and job number
Additionally the linked list is stored in sorted order according to command name
Implements ls command, taken care of 2 flags -l and -a given by user in any order
2 functions execute and execute_withstring both performs same function just different inputs
- Set signal
- Reading history
- Getting other essemtial things like tilda
- Taking input
- Tokenize them and execute
To display inpformation of pid given by user
Print the current directory
Implementation of repeat function
Implements I/O redirection taken care of <, >, >>
.
Implements piping command a | command b
where command a acts as input for command b
Prints all the background process initiated by my shell
Prints [job number] (process state) (process name) [process pid]
Job number is unique for each process and process state have 2 options either it will be stopped or running
Sorted by process name in case of ties they are sorted by job number.
Users can send signal to background process according to their job number.
To bring a background process into foreground
Changes the state of a stopped background job to running (int background).
- Ctrl+C sends SIGINT signal to child foreground process if no foreground process it does nothing.
- Ctrl+Z sends SIGSGTP signal to child foreground process thus sending it to background and the state becomes STOPPED.
- Ctrl+D logs out of the shell, before logging out it writes to history and free memory used by linked list.
- Path length, input string will be less than 1024 charcters
- Pinfo prints both virtual memory address/mapping and virtual memory size