-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
63 lines (53 loc) · 1.33 KB
/
Copy pathmain.c
File metadata and controls
63 lines (53 loc) · 1.33 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include "header.h"
#include "takeinput.h"
//#include "prompt.c"
// Greeting shell during startup
void init_shell()
{
clear();
printf("\n\n\n\n******************"
"************************");
printf("\n\n\n\t****Welcome to My Shell****");
printf("\n\n\t-USE AT YOUR OWN RISK-");
printf("\n\n\n\n*******************"
"***********************");
char* username = getenv("USER");
printf("\n\n\nUSER is: @%s", username);
printf("\n");
sleep(1);
clear();
}
void quit_shell()
{
clear();
printf("\n\n\n\n******************"
"************************");
printf("\n\n\n\t****Thankyou for using! Hope you liked it!****");
printf("\n\n\t\t******Terminating******");
printf("\n\n\n\n*******************"
"***********************");
char* username = getenv("USER");
printf("\n\n\nUSER is: @%s", username);
printf("\n");
sleep(1);
clear();
}
int main()
{
//char inputString[MAXCOM];
init_shell();
//char cwd[1024];
getcwd(cwd, sizeof(cwd));
strcpy(tilde,cwd);
while (1) {
// print shell line
prompt();
strcpy(exe_part,"");
takeinput();
if(strcmp(main_input, "quit") == 0)
{
quit_shell();
break;
}
}
}