Skip to content
Snippets Groups Projects
Commit ecad5e8e authored by ndomassi.tando_ird.fr's avatar ndomassi.tando_ird.fr
Browse files

ajout exo pour redirection avec &&

parent c6e3d18e
No related branches found
No related tags found
No related merge requests found
Pipeline #40305 passed
......@@ -186,6 +186,13 @@ You can redirect a result and store it in a file thanks to the `>` redirection:
grep ";2005;" nat2021.csv > selected_names.txt
```
!!! question "Erase the file `selected_names.txt`and reproduce the pratice by chaining commands with `&&`"
??? example "Click to show the solution"
```bash
rm -rf selected_names.txt && grep ";2005;" nat2021.csv > selected_names.txt && grep ";2006;" nat2021.csv >> selected_names.txt && wc -l selected_names.txt && grep ";2007;" nat2021.csv >> selected_names.txt && wc -l selected_names.txt
```
!!! question "Add all names from 2006 and 2007 into this file. Check the number of lines after each action"
??? example "Click to show the solution"
......@@ -197,7 +204,6 @@ You can redirect a result and store it in a file thanks to the `>` redirection:
wc -l selected_names.txt
```
## Replacing patterns (sed)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment