-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
210 lines (122 loc) · 4.42 KB
/
README.txt
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
Run the Shell:
1. Run the command 'make' followed by ./a.out
2. A prompt will be displayed.
3. Enter the commands into the shell and hit ENTER.
4. to exit from the shell, enter 'quit' and hit ENTER.
Features:
* Handled redirection, piping, ctrl+C, ctrl+Z,
1. cd:
Syntax: cd [path]
Description:
Change the current working directory to the directory specified in the path.
Error is displayed if no such path exists.
Can handle arguments [.], [..], [-] and [~].
Current working directory is displayed in the prompt.
Displays the absolute path of the shell when the present working directory is home (wrt shell) and path entered is [..].
Files: cd.c, cd.h
2. pwd:
Syntax: pwd
Description:
Prints the present working directory with respect to the shell.
Files: pwd.c, pwd.h
3. echo:
Syntax: echo [arguments]
Description:
Prints the arguments.
Multiline strings, environment variables, and quotes are not handeled.
Files: echo.c, echo.h
4. ls:
Syntax: ls [arguments]
Description:
Lists the directory contents of the path specified in arguments.
If the arguments is NULL, then directory contents of present working directory are displayed
If the path does not exist error is displayed
Can handle flags [-l], [-a], [-al]/[-la]
Files: ls.c, ls.h
5. system process:
Syntax: <command> [arguments]
Descritpion:
Runs the basic system process.
Can handle flag [&] for background processes
If process does not exist error is displayed
Files: system_process.c, system_process.h
6. pinfo:
Syntax: pinfo [pid]
Descritpion:
Displays pid, process status, memory and executable path of the process with pid entered.
If pid is NULL the details of process related to shell is displayed.
If no process exists with the pid given, error is displayed.
Files: pinfo.c, pinfo.h
7. finished background process
Syntax: No syntax
Description:
Whenever a background process exits, its exit details are diaplyed.
Files: bg_exit.c, bg_exit.h
8. nightswatch
Syntax: nightswatch -n [time] <command>
Description:
Runs <command> and displays the output every [time] seconds.
The commands that can be run are interrupt or newborn.
Interrupt displays the number of times each CPU was interrupted.
Newborn displays the most recently created process.
If command is not running, error is displayed.
On pressing q, it does not exit.
Files: nightswatch.c, nightswatch.h
9. history
Syntax: history [arguments]
Description:
Displays the last [argumnets] number of commands entered into the shell.
At max, only last 20 commands can be traced.
If [arguments] is NULL, last few commands, at max 10, are displayed.
If the file 'history.txt', is not created or is unable to access error is displayed.
Files: history.c, history.h
10. man
Syntax: man
Description:
Displays information and functionalities of shell
Files: man.c, man.h
11. setenv
Syntax: setenv var [value]
Description:
Creates an environment variable var with the given value. If an environment variable var already exists, it updates its value to 'value'
Files: env_var.c, env_var.h
12. unsetenv
Syntax: unsetenv var
Description:
Deletes an environment variable var.
Files: env_var.c, env_var.h
13. jobs
Syntax: jobs
Description:
Displays all the current background processes.
Files: show_jobs.c, show_jobs.h
14. kjob
Syntax: kjob [job_number] [signal_number]
Description:
Sends the signal with the signal number to the background process with the given job number.
Files: kjob.c, kjob.h
15. fg
Syntax: fg [job_number]
Description: Brings the running or stopped background job corresponding to job number to the foreground, and changes its state to running
Files: fg_bg.c, fg_bg.h
16. bg
Syntax: bg [job_number]
Description: Changes the state of a stopped background job to running (in the background).
Files: fg_bg.c, fg_bg.h
17. overkill
Syntax: overkill
Description: Kills all the background processes.
Files: overkill.c, overkill.h
Other files:
headers.h: Contains all the headers of imported C libraries
history.txt: Stores history of commands entered into the shell
makefile: Contains compilation command of shell
prompt.c: Code for prompt
prompt.h: headerfile for prompt
README.txt: displays basic information about shell
shell.c: contains main loop
takeinput.c: Code for taking input from the users and parseing it. Redirection and piping also implemented.
takeinput.h: headerfile for input
a.out: executable of the shell
bg_signal.c: Signal handling implemented
bg_signal.h: headerfile for signal handling