Skip to content
Extraits de code Groupes Projets
Valider 23d332b9 rédigé par Jérôme de Favereau de Jeneret's avatar Jérôme de Favereau de Jeneret
Parcourir les fichiers

added exercise 5

parent f636851a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!4Exercice 5 + quelques changements de formulation
......@@ -914,12 +914,12 @@ print_something Mars
# Hands-on exercise
1. Write a script called `exercise_5.sh` expecting **2 arguments**. If not exactly two arguments are provided, exit with an error and show a "usage" message to the user.
2. Write a function taking a **folder path** and an **extension** as arguments and giving the list of matching files to the user
<!-- 3. Imagine you are running jobs taking data from two folders, each with a dedicated extension. Use the two arguments of the script as the name of the two folders and **get the two lists of files**.
4. Since your work needs to read these files, **check that all files can be read**. If some files cannot be read, display their name to the user-->
<!-- Créer un petit exercice raisonnable-->
1. Write a script called `exercise_5.sh` expecting **2 arguments**. If not exactly two arguments are provided:
* Echo an error message
* Exit with a non-zero error code
2. Write a function taking a **folder path** (e.g `/home/ucl/elic/xxxx`) and an **extension** (e.g `py`) as arguments
3. Use the `ls` command to list the files in the given path having with the given extension. Write this list to a file called `files_found.txt`.
4. Bonus : if there are no files, Exit with a non-zero error code
---
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter