diff --git a/docs/pages/bash/bash-extracting_from_files.md b/docs/pages/bash/bash-extracting_from_files.md index 82e612fa48e00538a510f84d1030a533eab079a3..c349008523254eb9f89594aafc10867212f42499 100644 --- a/docs/pages/bash/bash-extracting_from_files.md +++ b/docs/pages/bash/bash-extracting_from_files.md @@ -186,12 +186,7 @@ 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" @@ -204,6 +199,13 @@ You can redirect a result and store it in a file thanks to the `>` redirection: wc -l 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 + ``` + ## Replacing patterns (sed)