-
Notifications
You must be signed in to change notification settings - Fork 0
/
tshref.out
230 lines (230 loc) · 6.58 KB
/
tshref.out
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
make[2]: Entering directory '/home/cs2400/csci-2400-labs-exams-extras/CU-labs/shlab-in-c++/src'
./sdriver.pl -t trace01.txt -s ./tsh -a "-p"
#
# trace01.txt - Properly terminate on EOF.
#
./sdriver.pl -t trace02.txt -s ./tsh -a "-p"
#
# trace02.txt - Process builtin quit command.
#
./sdriver.pl -t trace03.txt -s ./tsh -a "-p"
#
# trace03.txt - Run a foreground job.
#
tsh> quit
./sdriver.pl -t trace04.txt -s ./tsh -a "-p"
#
# trace04.txt - Run a background job.
#
tsh> ./myspin 1 &
[1] (8654) ./myspin 1 &
./myspin: Command not found
./sdriver.pl -t trace05.txt -s ./tsh -a "-p"
#
# trace05.txt - Process jobs builtin command.
#
tsh> ./myspin 2 &
[1] (8662) ./myspin 2 &
tsh> ./myspin 3 &
[2] (8664) ./myspin 3 &
./myspin: Command not found
tsh> jobs
./myspin: Command not found
./sdriver.pl -t trace06.txt -s ./tsh -a "-p"
#
# trace06.txt - Forward SIGINT to foreground job.
#
tsh> ./myspin 4
./myspin: Command not found
./sdriver.pl -t trace07.txt -s ./tsh -a "-p"
#
# trace07.txt - Forward SIGINT only to foreground job.
#
tsh> ./myspin 4 &
[1] (9175) ./myspin 4 &
tsh> ./myspin 5
./myspin: Command not found
./myspin: Command not found
tsh> jobs
./sdriver.pl -t trace08.txt -s ./tsh -a "-p"
#
# trace08.txt - Forward SIGTSTP only to foreground job.
#
tsh> ./myspin 4 &
[1] (9183) ./myspin 4 &
tsh> ./myspin 5
./myspin: Command not found
./myspin: Command not found
tsh> jobs
./sdriver.pl -t trace09.txt -s ./tsh -a "-p"
#
# trace09.txt - Process bg builtin command
#
tsh> ./myspin 4 &
[1] (9193) ./myspin 4 &
tsh> ./myspin 5
./myspin: Command not found
./myspin: Command not found
tsh> jobs
tsh> bg %2
%2: No such job
tsh> jobs
./sdriver.pl -t trace10.txt -s ./tsh -a "-p"
#
# trace10.txt - Process fg builtin command.
#
tsh> ./myspin 4 &
[1] (9205) ./myspin 4 &
./myspin: Command not found
tsh> fg %1
%1: No such job
tsh> jobs
tsh> fg %1
%1: No such job
tsh> jobs
./sdriver.pl -t trace11.txt -s ./tsh -a "-p"
#
# trace11.txt - Forward SIGINT to every process in foreground process group
#
tsh> ./mysplit 4
./mysplit: Command not found
tsh> /bin/ps a
PID TTY STAT TIME COMMAND
1010 ttyS0 Ss+ 0:00 /sbin/agetty -o -p -- \u --keep-baud 115200,38400,9600 ttyS0 vt220
1012 tty1 Ss+ 0:00 /sbin/agetty -o -p -- \u --noclear tty1 linux
3993 pts/0 Ss 0:00 -bash
8054 pts/0 S+ 0:00 make
8066 pts/0 S+ 0:00 /bin/sh -c (cd src; make)
8067 pts/0 S+ 0:00 make
8603 pts/0 S+ 0:00 /bin/sh -c make tests > tshref.out 2>&1
8604 pts/0 S+ 0:00 make tests
9211 pts/0 S+ 0:00 /bin/sh -c ./sdriver.pl -t trace11.txt -s ./tsh -a "-p"
9212 pts/0 S+ 0:00 /usr/bin/perl ./sdriver.pl -t trace11.txt -s ./tsh -a -p
9213 pts/0 S+ 0:00 ./tsh -p
9218 pts/0 R 0:00 /bin/ps a
./sdriver.pl -t trace12.txt -s ./tsh -a "-p"
#
# trace12.txt - Forward SIGTSTP to every process in foreground process group
#
tsh> ./mysplit 4
./mysplit: Command not found
tsh> jobs
tsh> /bin/ps a
PID TTY STAT TIME COMMAND
1010 ttyS0 Ss+ 0:00 /sbin/agetty -o -p -- \u --keep-baud 115200,38400,9600 ttyS0 vt220
1012 tty1 Ss+ 0:00 /sbin/agetty -o -p -- \u --noclear tty1 linux
3993 pts/0 Ss 0:00 -bash
8054 pts/0 S+ 0:00 make
8066 pts/0 S+ 0:00 /bin/sh -c (cd src; make)
8067 pts/0 S+ 0:00 make
8603 pts/0 S+ 0:00 /bin/sh -c make tests > tshref.out 2>&1
8604 pts/0 S+ 0:00 make tests
9219 pts/0 S+ 0:00 /bin/sh -c ./sdriver.pl -t trace12.txt -s ./tsh -a "-p"
9220 pts/0 S+ 0:00 /usr/bin/perl ./sdriver.pl -t trace12.txt -s ./tsh -a -p
9221 pts/0 S+ 0:00 ./tsh -p
9226 pts/0 R 0:00 /bin/ps a
./sdriver.pl -t trace13.txt -s ./tsh -a "-p"
#
# trace13.txt - Restart every stopped process in process group
#
tsh> ./mysplit 4
./mysplit: Command not found
tsh> jobs
tsh> /bin/ps a
PID TTY STAT TIME COMMAND
1010 ttyS0 Ss+ 0:00 /sbin/agetty -o -p -- \u --keep-baud 115200,38400,9600 ttyS0 vt220
1012 tty1 Ss+ 0:00 /sbin/agetty -o -p -- \u --noclear tty1 linux
3993 pts/0 Ss 0:00 -bash
8054 pts/0 S+ 0:00 make
8066 pts/0 S+ 0:00 /bin/sh -c (cd src; make)
8067 pts/0 S+ 0:00 make
8603 pts/0 S+ 0:00 /bin/sh -c make tests > tshref.out 2>&1
8604 pts/0 S+ 0:00 make tests
9227 pts/0 S+ 0:00 /bin/sh -c ./sdriver.pl -t trace13.txt -s ./tsh -a "-p"
9228 pts/0 S+ 0:00 /usr/bin/perl ./sdriver.pl -t trace13.txt -s ./tsh -a -p
9229 pts/0 S+ 0:00 ./tsh -p
9237 pts/0 R 0:00 /bin/ps a
tsh> fg %1
%1: No such job
tsh> /bin/ps a
PID TTY STAT TIME COMMAND
1010 ttyS0 Ss+ 0:00 /sbin/agetty -o -p -- \u --keep-baud 115200,38400,9600 ttyS0 vt220
1012 tty1 Ss+ 0:00 /sbin/agetty -o -p -- \u --noclear tty1 linux
3993 pts/0 Ss 0:00 -bash
8054 pts/0 S+ 0:00 make
8066 pts/0 S+ 0:00 /bin/sh -c (cd src; make)
8067 pts/0 S+ 0:00 make
8603 pts/0 S+ 0:00 /bin/sh -c make tests > tshref.out 2>&1
8604 pts/0 S+ 0:00 make tests
9227 pts/0 S+ 0:00 /bin/sh -c ./sdriver.pl -t trace13.txt -s ./tsh -a "-p"
9228 pts/0 S+ 0:00 /usr/bin/perl ./sdriver.pl -t trace13.txt -s ./tsh -a -p
9229 pts/0 S+ 0:00 ./tsh -p
9240 pts/0 R 0:00 /bin/ps a
./sdriver.pl -t trace14.txt -s ./tsh -a "-p"
#
# trace14.txt - Simple error handling
#
tsh> ./bogus
./bogus: Command not found
tsh> ./myspin 4 &
[1] (9247) ./myspin 4 &
tsh> fg
fg command requires PID or %jobid argument
./myspin: Command not found
tsh> bg
bg command requires PID or %jobid argument
tsh> fg a
fg: argument must be a PID or %jobid
tsh> bg a
bg: argument must be a PID or %jobid
tsh> fg 9999999
(9999999): No such process
tsh> bg 9999999
(9999999): No such process
tsh> fg %2
%2: No such job
tsh> fg %1
%1: No such job
tsh> bg %2
%2: No such job
tsh> bg %1
%1: No such job
tsh> jobs
./sdriver.pl -t trace15.txt -s ./tsh -a "-p"
#
# trace15.txt - Putting it all together
#
tsh> ./bogus
./bogus: Command not found
tsh> ./myspin 10
./myspin: Command not found
tsh> ./myspin 3 &
[1] (9268) ./myspin 3 &
tsh> ./myspin 4 &
[2] (9270) ./myspin 4 &
./myspin: Command not found
tsh> jobs
[2] (9270) Running ./myspin 4 &
./myspin: Command not found
tsh> fg %1
%1: No such job
tsh> jobs
tsh> bg %3
%3: No such job
tsh> bg %1
%1: No such job
tsh> jobs
tsh> fg %1
%1: No such job
tsh> quit
./sdriver.pl -t trace16.txt -s ./tsh -a "-p"
#
# trace16.txt - Tests whether the shell can handle SIGTSTP and SIGINT
# signals that come from other processes instead of the terminal.
#
tsh> ./mystop 2
./mystop: Command not found
tsh> jobs
tsh> ./myint 2
./myint: Command not found
make[2]: Leaving directory '/home/cs2400/csci-2400-labs-exams-extras/CU-labs/shlab-in-c++/src'