This is a Shell developed entirely in C. The shell emulates the normal bash in linux systems. It is able to handle bakground processes, foreground processes, input-output redirection, command redirection etc.
##Display
- The format is <username@system_name:curr_dir>
- ~ signifies the address of Home Directory.
- Prints the path present working directory.
- cd changes the pwd to the specified directory path.
- lists all the file in the pwd.
- Prints the process related info of Shell program.
- prints the process info about given pid.
- Tells the last 10 commands executed on shell.
- Prints the last 'n' commands.
- 'n' is specified by user.
- All other commands like cat, grep, etc. can be executed through the shell.
- The difference is that they are builtin and ls, pwd, cd were built by me.
- If the enviroment variable does not exist, then creates it.
- Modifies the existing value if the environment variable already exists.
- Destroys the evironment variable if exists.
- prints all the currently running jobs along with their pids.
- Takes the job number of the process and sends the signal specified by signalNumber to it.
- Brings the job running in background to the foreground.
- Changes a stopped background job to a running background job.
- Kills all background process at once.
- Exits the shell.
- Changes teh currently running job to stop, and pushes it to background process.
- Sends a SIGINT signal to the current forground job of this shell.
- If there is no foreground process currently this should have no effect.
- Just type the command's name you want to run.
- These processes have the access of input and output on the terminal window.
- Example
vim bello;ls;
- Type the command's name you want to execute. End it with a &.
- These processes run in the background meaning they do not have input and output accesses from the terminal window.
- Example
vim bello &
- Input Redirection
sort < lines.txt
- Output Redirection
cat bello.txt > hello.txt //Overwriting hello.txt
cat bello.txt >> hello.txt //Appending to hello.txt
- Input-Output Redirection
sort < lines.txt > output.txt
- A pipe is a basically a channel of communication between two processes.
- Identified by '|'
- Example
cat bello.txt | grep hello
ls | grep *.txt > out.txt