Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion subjects/0-shell/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ You must implement the following commands **from scratch**, using system-level R
- `cd`
- `ls` (supporting `-l`, `-a`, `-F`)
- `pwd`
- `cat`
- `cat` (including no-argument mode)
- `cp`
- `rm` (supporting `-r`)
- `mv`
Expand Down
6 changes: 6 additions & 0 deletions subjects/0-shell/audit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ The use of external binaries or system calls that spawn them is strictly forbidd

###### Can you confirm that the document `new_doc.txt` is inside the `new_folder2`?

##### Try to run the command `cat` with no arguments.

###### Can you confirm that you can type some text and see it displayed back?

###### Can you confirm that you can stop with `Ctrl+D`?

##### Try to run the command `cat new_folder1/new_doc`. Do the same in your computer terminal.

###### Can you confirm that the output is the same in the project and in your computer terminal?
Expand Down
42 changes: 18 additions & 24 deletions subjects/0-shell/job-control/README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,18 @@
## job control
# Job Control

### Objectives

You must follow the same [principles](https://public.01-edu.org/subjects/0-shell/) as the first subject.

Job control refers to the ability to selectively stop (suspend) the execution of processes and continue (resume) their execution at a later point.

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):

- jobs
- bg
- fg
- kill

You must also be able to stop jobs with the `Ctrl + Z`.
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.

### Instructions

- 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**.
- The code must respect the [good practices](https://public.01-edu.org/subjects/good-practices/)

This project will help you learn about:

- Job control
- Process creation and synchronization
- Commands syntax
- Scripting language
- The project has to be written in a Rust.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The project has to be written in Rust *

- The project must follow the same [principles](https://public.01-edu.org/subjects/0-shell/) as the first subject.
- The code must respect the [good practices](https://public.01-edu.org/subjects/good-practices/).
- You must implement the following commands:
- The `&` operator to run processes in the background.
- `jobs` (supporting `-r`, `-l`, `-p`, `-s`)
- `bg`
- `fg`
- `kill` (including handling for job specifiers like `%1`)

### Usage

Expand All @@ -48,3 +35,10 @@ $ jobs
$ exit
student$
```

### Learning objectives
This project will help you learn about:
- Job control
- Process creation and synchronization
- Commands syntax
- Scripting language
99 changes: 0 additions & 99 deletions subjects/0-shell/job-control/audit.md

This file was deleted.

46 changes: 23 additions & 23 deletions subjects/0-shell/job-control/audit/README.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
#### General

###### Was the project written in a compiled programming language?
###### Was the project written in Rust?

#### Functional

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

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

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

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

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

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

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

```
13612
```

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

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

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

###### 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?
###### 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?

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

```
[1] Running tar -czf home.tar.gz . &
[1] Running ls -lRr / 2>1 >/dev/null &
[2]- Running sleep 50000 &
```

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

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

```
[3]+ Stopped python
[3]+ Stopped cat
```

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

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

```
[2]- Terminated sleep 50000
```

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

##### Try to run the command `"kill %1"`.
##### Try to run the command `kill %1`.

```
[1] Terminated tar -czf home.tar.gz
[1] Terminated ls -lRr / 2>1 >/dev/null
```

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

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

```
sleep 50000
Expand All @@ -80,20 +80,20 @@ sleep 50000

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

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

```
sleep 50000
^Z
[2]+ Stopped sleep 50000
```

###### 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?
###### 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?

##### Try to run the command `"bg"`.
##### Try to run the command `bg`.

```
[2]+ sleep 50000 &
```

###### Run `"jobs"`. Can you confirm that the program started the process in the background like in the example above?
###### Run `jobs`. Can you confirm that the program started the process in the background like in the example above?
2 changes: 1 addition & 1 deletion subjects/0-shell/scripting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ myfunc() {

- You have to create your own script.
- The `0-shell` must be able to read and execute scripts.
- 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**.
- The project has to be written in **Rust**.
- The code must respect the [good practices](https://public.01-edu.org/subjects/good-practices/)

This project will help you learn about:
Expand Down
61 changes: 0 additions & 61 deletions subjects/0-shell/scripting/audit.md

This file was deleted.

2 changes: 1 addition & 1 deletion subjects/0-shell/scripting/audit/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#### General

###### Was the project written in a compiled programming language?
###### Was the project written in Rust?

###### Was the student shell script created?

Expand Down
2 changes: 1 addition & 1 deletion subjects/forum/advanced-features/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ We encourage you to add any other additional features that you find relevant.

### This project will help you learn about:

- Real-time notifications
- Users notifications
- Users activity tracking
Loading