Linux Terminal interpreter in C
OS Lab Mini Project
Clone your forked repo using
git clone https://github.com/Your-Username/Elf.git
Change Directory to Elf, using
cd Elf
Add remote branch using
git remote add upstream https://github.com/aashutoshrathi/Elf.git
Do your work in a seprate branch never make a function in master itself.
Create a new branch using
git checkout -b "Branch-Name"
When completed push your work, and Send a Pull-Request.
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int function(void); // Declaration
int main() {
char arg[1024];
while(strcmp(arg,"exit") != 0){
printf("myshell$ "); // As we are making bash.
scanf("%s", arg);
switch(arg[0]) {
case 'TriggerKey':
function();
}
}
exit(0);
}
int function() {
/*
Your implementation here...
*/
}