File: jobs.right

package info (click to toggle)
bash 4.4-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 36,372 kB
  • sloc: ansic: 103,485; sh: 7,655; yacc: 5,214; makefile: 4,357; perl: 4,227; asm: 48; awk: 23; sed: 16
file content (108 lines) | stat: -rw-r--r-- 2,832 bytes parent folder | download
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
./jobs2.sub: line 9: fg: job 1 started without job control
fg: 1
Waiting for job 0
job 0 returns 0
Waiting for job 1
job 1 returns 0
Waiting for job 2
job 2 returns 0
Waiting for job 3
job 3 returns 0
Waiting for job 4
job 4 returns 0
Waiting for job 5
job 5 returns 0
Waiting for job 6
job 6 returns 0
Waiting for job 7
job 7 returns 0
[1]   Running                 sleep 5 &
[2]   Running                 sleep 5 &
[3]   Running                 sleep 5 &
[4]-  Running                 sleep 5 &
[5]+  Running                 ( sleep 5; exit 4 ) &
4
0
i killed it
12
[1]-  Running                 sleep 20 &
[3]+  Running                 sleep 20 &
0
./jobs.tests: line 22: wait: %1: no such job
./jobs.tests: line 27: fg: no job control
wait-for-pid
wait-errors
./jobs.tests: line 40: wait: `1-1': not a pid or valid job spec
./jobs.tests: line 41: wait: `-4': not a pid or valid job spec
wait-for-background-pids
async list wait-for-background-pids
async list wait for child
forked
wait-when-no-children
wait-for-job
./jobs.tests: line 63: wait: %2: no such job
127
async list wait-for-job
forked
fg-bg 1
sleep 5
fg-bg 2
sleep 5
fg-bg 3
sleep 5
fg-bg 4
sleep 5
fg-bg 5
./jobs.tests: line 90: fg: %2: no such job
./jobs.tests: line 91: bg: job 1 already in background
fg-bg 6
./jobs.tests: line 98: fg: -s: invalid option
fg: usage: fg [job_spec]
./jobs.tests: line 99: bg: -s: invalid option
bg: usage: bg [job_spec ...]
./jobs.tests: line 104: disown: -s: invalid option
disown: usage: disown [-h] [-ar] [jobspec ... | pid ...]
./jobs.tests: line 108: disown: %1: no such job
./jobs.tests: line 111: disown: %2: no such job
wait-for-non-child
./jobs.tests: line 114: wait: pid 1 is not a child of this shell
127
3 -- 1 2 3 -- 1 - 2 - 3
[1]   Running                 sleep 300 &
[2]-  Running                 sleep 350 &
[3]+  Running                 sleep 400 &
running jobs:
[1]   Running                 sleep 300 &
[2]-  Running                 sleep 350 &
[3]+  Running                 sleep 400 &
./jobs.tests: line 131: kill: %4: no such job
./jobs.tests: line 133: jobs: %4: no such job
current job:
[3]+  Running                 sleep 400 &
previous job:
[2]-  Running                 sleep 350 &
after kill -STOP
running jobs:
[1]   Running                 sleep 300 &
[3]-  Running                 sleep 400 &
stopped jobs:
[2]+  Stopped                 sleep 350
after disown
[2]+  Stopped                 sleep 350
[3]-  Running                 sleep 400 &
running jobs:
[3]-  Running                 sleep 400 &
stopped jobs:
[2]+  Stopped                 sleep 350
after kill -s CONT
running jobs:
[2]+  Running                 sleep 350 &
[3]-  Running                 sleep 400 &
stopped jobs:
after kill -STOP, backgrounding %3:
[3]+ sleep 400 &
killing...
done
after KILL -STOP, foregrounding %1
sleep 10
done