Skip to content

Commit 5f620db

Browse files
docs(job-control): updated the project description for clarity
1 parent 57e2b2e commit 5f620db

File tree

3 files changed

+41
-146
lines changed

3 files changed

+41
-146
lines changed
Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,18 @@
1-
## job control
1+
# Job Control
22

33
### Objectives
4-
5-
You must follow the same [principles](https://public.01-edu.org/subjects/0-shell/) as the first subject.
6-
7-
Job control refers to the ability to selectively stop (suspend) the execution of processes and continue (resume) their execution at a later point.
8-
9-
In `job control`, you will have to implement the following [builtins](https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Job-Control-Builtins):
10-
11-
- jobs
12-
- bg
13-
- fg
14-
- kill
15-
16-
You must also be able to stop jobs with the `Ctrl + Z`.
4+
In this project, you'll extend the `0-shell` project by adding `job control`. Job control refers to the ability to selectively stop (suspend) the execution of processes and continue (resume) their execution at a later point. With job control, your shell will let users run processes both in the foreground and background.
175

186
### Instructions
19-
20-
- The project has to be written in a compiled language like (C, Rust Go or other), **interpreted languages like (Perl and others) are not allowed**.
21-
- The code must respect the [good practices](https://public.01-edu.org/subjects/good-practices/)
22-
23-
This project will help you learn about:
24-
25-
- Job control
26-
- Process creation and synchronization
27-
- Commands syntax
28-
- Scripting language
7+
- The project has to be written in a Rust.
8+
- The project must follow the same [principles](https://public.01-edu.org/subjects/0-shell/) as the first subject.
9+
- The code must respect the [good practices](https://public.01-edu.org/subjects/good-practices/).
10+
- You must implement the following commands:
11+
- The `&` operator to run processes in the background.
12+
- `jobs` (supporting `-r`, `-l`, `-p`, `-s`)
13+
- `bg`
14+
- `fg`
15+
- `kill` (including handling for job specifiers like `%1`)
2916

3017
### Usage
3118

@@ -48,3 +35,10 @@ $ jobs
4835
$ exit
4936
student$
5037
```
38+
39+
### Learning objectives
40+
This project will help you learn about:
41+
- Job control
42+
- Process creation and synchronization
43+
- Commands syntax
44+
- Scripting language

subjects/0-shell/job-control/audit.md

Lines changed: 0 additions & 99 deletions
This file was deleted.
Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,77 @@
11
#### General
22

3-
###### Was the project written in a compiled programming language?
3+
###### Was the project written in Rust?
44

55
#### Functional
66

7-
##### Try to run the command `"tar -czf home.tar.gz . &"` then run the command `"jobs"`.
7+
##### Try to run the command `ls -lRr / 2>1 >/dev/null &` then run the command `jobs`.
88

99
```
10-
[1]+ Running tar -czf home.tar.gz . &
10+
[1]+ Running ls -lRr / 2>1 >/dev/null &
1111
```
1212

1313
###### Can you confirm that the program displayed a list with the status of all jobs like in the example above?
1414

15-
##### Try to run the command `"jobs -l"`.
15+
##### Try to run the command `jobs -l`.
1616

1717
```
18-
[1]+ 13612 Running tar -czf home.tar.gz . &
18+
[1]+ 13612 Running ls -lRr / 2>1 >/dev/null &
1919
```
2020

21-
###### Can you confirm that the program added the process ID to the normal information given in the command `"jobs"` like in the example above?
21+
###### Can you confirm that the program added the process ID to the normal information given in the command `jobs` like in the example above?
2222

23-
##### Try to run the command `"jobs -p"`.
23+
##### Try to run the command `jobs -p`.
2424

2525
```
2626
13612
2727
```
2828

2929
###### Can you confirm that the program only displays the process ID like in the example above?
3030

31-
##### Try to run the command `"sleep 50000 &"` then run `"python &"` and press enter without any input in the last command.
31+
##### Try to run the command `sleep 50000 &` then run `cat &` and press enter without any input in the last command.
3232

3333
```
34-
[1] Running tar -czf home.tar.gz . &
34+
[1] Running ls -lRr / 2>1 >/dev/null &
3535
[2]- Running sleep 50000 &
36-
[3]+ Stopped python
36+
[3]+ Stopped cat
3737
```
3838

39-
###### Run the command `"jobs"`. Can you confirm that the program displays the list with the status of all jobs and that one of them is "Stopped" like the example above?
39+
###### Run the command `jobs`. Can you confirm that the program displays the list with the status of all jobs and that one of them is "Stopped" like the example above?
4040

41-
##### Try to run the command `"jobs -r"`.
41+
##### Try to run the command `jobs -r`.
4242

4343
```
44-
[1] Running tar -czf home.tar.gz . &
44+
[1] Running ls -lRr / 2>1 >/dev/null &
4545
[2]- Running sleep 50000 &
4646
```
4747

4848
###### Can you confirm that the program only displays the list with running jobs like in the example above?
4949

50-
##### Try to run the command `"jobs -s"`.
50+
##### Try to run the command `jobs -s`.
5151

5252
```
53-
[3]+ Stopped python
53+
[3]+ Stopped cat
5454
```
5555

5656
###### Can you confirm that the program only displays the list with stopped jobs like in the example above?
5757

58-
##### Try to run the command `"kill 7764"`(the process ID must be yours this is just an example).
58+
##### Try to run the command `kill 7764`(the process ID must be yours this is just an example).
5959

6060
```
6161
[2]- Terminated sleep 50000
6262
```
6363

6464
###### Can you confirm that the program killed and displayed the process with the given id like in the example above?
6565

66-
##### Try to run the command `"kill %1"`.
66+
##### Try to run the command `kill %1`.
6767

6868
```
69-
[1] Terminated tar -czf home.tar.gz
69+
[1] Terminated ls -lRr / 2>1 >/dev/null
7070
```
7171

7272
###### Can you confirm that the program killed and displayed the first process like in the example above?
7373

74-
##### Close the program and run it again. Try to run the commands `"tar -czf home.tar.gz . &"`, `"sleep 50000 &"` and then run `"fg"`.
74+
##### Close the program and run it again. Try to run the commands `ls -lRr / 2>1 >/dev/null &`, `sleep 50000 &` and then run `fg`.
7575

7676
```
7777
sleep 50000
@@ -80,20 +80,20 @@ sleep 50000
8080

8181
###### Can you confirm that the program brings the background job to the foreground like in the example above?
8282

83-
##### Try to run the command `"fg"` then stop the process with the `"Ctrl + Z"`.
83+
##### Try to run the command `fg` then stop the process with the `Ctrl + Z`.
8484

8585
```
8686
sleep 50000
8787
^Z
8888
[2]+ Stopped sleep 50000
8989
```
9090

91-
###### Can you confirm that the program brings the background job to the foreground and after you press `"Ctrl + Z"` the process stops like in the example above?
91+
###### Can you confirm that the program brings the background job to the foreground and after you press `Ctrl + Z` the process stops like in the example above?
9292

93-
##### Try to run the command `"bg"`.
93+
##### Try to run the command `bg`.
9494

9595
```
9696
[2]+ sleep 50000 &
9797
```
9898

99-
###### Run `"jobs"`. Can you confirm that the program started the process in the background like in the example above?
99+
###### Run `jobs`. Can you confirm that the program started the process in the background like in the example above?

0 commit comments

Comments
 (0)