This repository was archived by the owner on Feb 25, 2022. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathTESTS
More file actions
247 lines (234 loc) · 5.5 KB
/
Copy pathTESTS
File metadata and controls
247 lines (234 loc) · 5.5 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
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
Typescript of a typical pty test run. EOF indicated by [^D]. Beeps
indicated by ^G.
Script started on Fri Dec 20 01:17:45 PST 1991
csh% who
bernstei ttyp0 Dec 20 01:15 (annex2.Berkeley.)
bernstei ttyq3 Dec 20 01:17 (script)
csh% /bin/who
bernstei ttyp0 Dec 20 01:15 (annex2.Berkeley.)
bernstei ttyq3 Dec 20 01:17 (script)
csh% users
bernstei bernstei
csh% /usr/ucb/users
bernstei bernstei
csh% tty
/dev/ttyq3
csh% /bin/tty
/dev/ttyq3
csh% who am i
fred!bernstei ttyq3 Dec 20 01:17 (script)
csh% /bin/who am i
fred!bernstei ttyq3 Dec 20 01:17 (script)
csh% who am i < /dev/tty
csh% /bin/who am i < /dev/tty
csh% who am i < /dev/null
who: fatal: stdin not a tty
csh% /bin/who am i < /dev/null
bernstei tty?? Dec 20 01:18
csh% whoami
bernstei
csh% /usr/ucb/whoami
bernstei
csh% echo hi > /dev/tty
hi
csh% echo hi > /dev/ttyq3
hi
csh% exclon
csh% echo hi > /dev/tty
/dev/tty: Device busy
csh% echo hi > /dev/ttyq3
/dev/ttyq3: Device busy
csh% excloff
csh% argv0 /usr/lib/sendmail mailq
Mail Queue (1 request)
--QID-- -Size- ----Q-Time----- ------------Sender/Recipient------------
AA09963* (no control file)
csh% lock
Key:
Again:
Bad password!
^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^Gcsh% lock
Key:
Again:
^Gcsh% biff
is n
csh% mesg
is y
csh% pty pwd
/tmp/pty
csh% pty who
bernstei ttyp0 Dec 20 01:15 (annex2.Berkeley.)
bernstei ttyq3 Dec 20 01:17 (script)
csh% pty pty pty pty pty pwd
/tmp/pty
csh% time pty pty pty pty pty pty pty pty pty pty pty pty pty pty pty pty pwd
/tmp/pty
0.0u 0.3s 0:21 1% 0+104k 0+0io 5pf+0w
csh% pty -xu who
bernstei ttyp0 Dec 20 01:15 (annex2.Berkeley.)
bernstei ttyq3 Dec 20 01:17 (script)
bernstei ttyr4 Dec 20 01:23 (pty4.0)
csh% pty -xu pty -xu pty -xu who
bernstei ttyp0 Dec 20 01:15 (annex2.Berkeley.)
bernstei ttyq3 Dec 20 01:17 (script)
bernstei ttyr7 Dec 20 01:23 (pty4.0)
bernstei ttyr9 Dec 20 01:23 (pty4.0)
bernstei ttyrb Dec 20 01:23 (pty4.0)
csh% pty -xRu pty -xRu pty -xRu who
bernstei ttyp0 Dec 20 01:15 (annex2.Berkeley.)
bernstei ttyp2 Dec 20 01:23 (pty4.0)
bernstei ttyp3 Dec 20 01:23 (pty4.0)
bernstei ttyp4 Dec 20 01:23 (pty4.0)
bernstei ttyq3 Dec 20 01:17 (script)
csh% pty -xu -h random who
bernstei ttyp0 Dec 20 01:15 (annex2.Berkeley.)
bernstei ttyq3 Dec 20 01:17 (script)
bernstei ttyrb Dec 20 01:24 (random)
csh% tty
/dev/ttyq3
csh% ttydetach sh
$ echo $$
2138
$ ps 2138
PID TT STAT TIME COMMAND
2138 ? S 0:00 sh
$ [^D] csh% ttydetach pty -d pwd
/tmp/pty
csh% pty -d pwd
/tmp/pty
csh% tr '[A-Z]' '[a-z]' | cat -t
one line of input
another
and yet another
why no output?
[^D] one line of input
another
and yet another
why no output?
csh% nobuf tr '[A-Z]' '[a-z]' | cat -t
one line of input
one line of input
ah, instant response!
ah, instant response!
the joy of buffer control!
the joy of buffer control!
[^D] csh% sess sh
$ echo $PTY
r7
$ sesslist
session r7 pid 2174 slave 2175 connected
$ sesswho
r7 Dec 20 01:29 bernstei 2174
$ sesswhere
r7 Dec 20 01:29 connect (unknown)
$ disconnect
csh% sesslist
session r7 pid 2174 slave 2175 disconnected
csh% sesswho
r7 Dec 20 01:29 bernstei 2174
csh% sess sh
$ sesslist
session r7 pid 2174 slave 2175 disconnected
session qf pid 2187 slave 2188 connected
$ sessname 'foo-prompt'
$ PS1=foo-prompt' '
foo-prompt sesslist
session r7 pid 2174 slave 2175 disconnected
session qf pid 2187 slave 2188 connected: foo-prompt
foo-prompt sessname
session qf: foo-prompt
foo-prompt reconnect r7
reconnect: will connect to session r7 when session qf is done
foo-prompt disconnect
pty: info: reconnecting to r7
pty: info: successfully connected to r7
$
$ reconnect qf
reconnect: will connect to session qf when session r7 is done
$ disconnect
pty: info: reconnecting to qf
pty: info: successfully connected to qf
foo-prompt reconnect r7
reconnect: will connect to session r7 when session qf is done
foo-prompt disconnect
pty: info: reconnecting to r7
pty: info: successfully connected to r7
$ reconnect qf
reconnect: will connect to session qf when session r7 is done
$ sesslist
session r7 pid 2174 slave 2175 connected (will drop into qf)
session qf pid 2187 slave 2188 disconnected: foo-prompt
$ [^D] pty: info: reconnecting to qf
pty: info: successfully connected to qf
foo-prompt sesslist
session qf pid 2187 slave 2188 connected: foo-prompt
foo-prompt sesswhere
qf Dec 20 01:32 connect (unknown)
foo-prompt sesswho
qf Dec 20 01:31 bernstei 2187
foo-prompt sesslist
session qf pid 2187 slave 2188 connected: foo-prompt
foo-prompt sesskill -mysqf
csh% set notify
csh% pty sh
$ ^Z
Stopped
csh% bg
[1] pty sh &
[1] + Stopped (tty output) pty sh
csh% bg
[1] pty sh &
[1] + Stopped (tty output) pty sh
csh% bg
[1] pty sh &
[1] + Stopped (tty output) pty sh
csh% bg
[1] pty sh &
csh% bg
[1] + Stopped (tty output) pty sh
[1] pty sh &
csh% bg
bg: No current job.
csh% bg
bg: No current job.
[1] + Stopped (tty output) pty sh
csh% bg
[1] pty sh &
csh%
[1] + Stopped (tty output) pty sh
bg
[1] pty sh &
csh%
[1] + Stopped (tty output) pty sh
bg;bg;bg;
[1] pty sh &
[1] + Stopped (tty output) pty sh
[1] pty sh &
bg: No current job.
csh%
[1] + Stopped (tty output) pty sh
csh% fg
pty sh
$
$ [^D] csh% pty sh &
[1] 2224
csh%
[1] + Stopped (tty output) pty sh
csh% bg
[1] pty sh &
[1] + Stopped (tty output) pty sh
csh% bg
[1] pty sh &
[1] + Stopped (tty output) pty sh
csh% fg
pty sh
$
$
$
$ [^D] csh% pty sh
$ echo $PTY
r6
$ ttydetach sh
$ echo $PTY
$ [^D] $ [^D] csh% jobs
csh% [^D] Script done on Fri Dec 20 01:40:01 PST 1991