-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdescription.txt
152 lines (114 loc) · 2.55 KB
/
description.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
Description of the shell:
Internal commands -- cd, pwd, echo, exit
cd options: cd "dir_name"
cd -L "dir_name"
cd -P "dir_name"
cd --help
pwd options: pwd
pwd -L
pwd -P
pwd --help
echo options: echo "string"
echo -n "string"
echo -E "string"
exit: To eit the command line or shell
External commands -- mkdir, rm, date, cat, ls
mkdir options: mkdir "folder name"
mkdir -v "folder name"
mkdir --version
rm options: rm "file name"
rm -v "file name"
rm -d "directory name"
date options: date
date -U
date -R
cat options: cat "filename"
cat -E "filename"
cat -T "filename"
ls options: ls
ls -a
ls -m
ls --version
These all commands are handled with fork, wait and execvp
If we &t is written and then these commands are executed then
they will be executed by pthread_create, system, pthread_join
All the corner cases are handled and program is running succesfully
Assumption: I assumed that the present working directory is not to be shown everytime. I just showed @> everytime in the shell.
we can get present working directory by pwd command.
Corner cases:
1. If the user enter nothing there will be continuation
2. If user enters the command which is not present in Description, shell will show Invalid Input.
3. If the user enters the wrong option of the command it shows Invalid Input -- option
4. If the user enters wrong or invalid directory it shows Error : No such file or directory
Test case:
// Internal commands
cd ..
pwd
cd -P assignment1
pwd
cd --help
pwd -L
pwd -p
pwd --help
cd -L assignment1
echo
echo hello
echo -n hello
echo -E hello
// same with pthreads
&t cd ..
&t pwd
&t cd assignment1
&t pwd
&t cd --help
&t pwd -L
&t pwd -p
&t pwd --help
&t cd -L assignment1
&t echo
&t echo hello
&t echo -n hello
&t echo -E hello
exit
// External commands
date
date -U
date -R
ls
ls -a
ls -m
ls --version
cat cat.c
cat -E cat.c
cat -T cat.c
mkdir hello
rm -d hello
mkdir -v hello
rm -d hello
mkdir --version
// new.txt and new1.txt will be created
rm -v new.txt
rm new1.txt
exit
// with pthreading
&t date
&t date -U
&t date -R
&t ls
&t ls -a
&t ls -m
&t ls --version
exit
&t cat cat.c
&t cat -E cat.c
&t cat -T cat.c
&t mkdir hello
&t rm -d hello
&t mkdir -v hello
&t rm -d hello
&t mkdir --version
exit
// new.txt and new1.txt will be created
&t rm -v new.txt
&t rm new1.txt
exit