-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathshell.c
More file actions
27 lines (23 loc) · 683 Bytes
/
Copy pathshell.c
File metadata and controls
27 lines (23 loc) · 683 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <stdio.h>
#include "shell.h"
#include "shellfunctions.h"
#include "shellCmds.h"
int main(){
int i;
initShell();
while(1){
resetShell();
printPrompt();
yyparse();
checkalias = checkAlias();
if(checkalias == SYSERR) {printf("Error: %s\n", errorMsg); continue;}
if(checkalias == WARNING) {printf("Warning: %s\n", warMsg);}
checkcommand = checkCmd();
if(checkcommand == SYSERR) {printf("Error: %s\n", errorMsg); continue;}
if(checkcommand == WARNING) {printf("Warning: %s\n", warMsg);}
//printCommands();
ret = execute();
if(ret == SYSERR) {printf("Error: %s\n", errorMsg); continue;}
if(ret == CLOSE) {system("clear"); return 0;}
}
}