une suite d instructions executees dans un ordre clair.
atelier
Bash
parcours pratique pour apprendre Bash depuis zero
definition d abord
ce que signifie Bash
Bash sert a ecrire des instructions precises. Ici tu l abordes comme parcours pratique pour apprendre Bash depuis zero. Commence par une idee simple: des entrees passent par des etapes et deviennent une sortie.
script.shexecuter bash script.shhabitude apprends une petite piece de Bash, tape un exemple minimal et execute-leune valeur est une donnee. Une variable est le nom qui la garde.
un petit travail nomme qui recoit une entree et produit un resultat.
POSIX shell compatible terminal execute le code de script.sh.
premier code lisible
Commands
pwd ls cd echoname="Ada" echo "$name"
sortie Adalignee du langage
arbre de Bash
vois d ou vient Bash, quels langages sont proches, et quoi apprendre ensuite.
utile pour parcours pratique pour apprendre Bash depuis zero
parcours debutant
Banque de questions
Chercher puis pratiquer
Choisis une etape ou cherche dans la banque de ce langage puis ouvre l exercice.
Bash question 1
Bash question 1. Choisis l explication qui correspond le mieux a echo output.
Bash question 2
Bash question 2. Choisis l explication qui correspond le mieux a variable assignment.
Bash question 3
Bash question 3. Choisis l explication qui correspond le mieux a pipe.
Bash question 4
Bash question 4. Choisis l explication qui correspond le mieux a for loop.
Bash question 5
Bash question 5. Choisis l explication qui correspond le mieux a echo output.
Bash question 6
Bash question 6. Choisis l explication qui correspond le mieux a variable assignment.
Bash question 7
Bash question 7. Choisis l explication qui correspond le mieux a pipe.
Bash question 8
Bash question 8. Choisis l explication qui correspond le mieux a for loop.
Bash question 9
Bash question 9. Choisis l explication qui correspond le mieux a echo output.
Bash question 10
Bash question 10. Choisis l explication qui correspond le mieux a variable assignment.
Bash question 11
Bash question 11. Choisis l explication qui correspond le mieux a pipe.
Bash question 12
Bash question 12. Choisis l explication qui correspond le mieux a for loop.
Bash question 13
Bash question 13. Choisis l explication qui correspond le mieux a echo output.
Bash question 14
Bash question 14. Choisis l explication qui correspond le mieux a variable assignment.
Bash question 15
Bash question 15. Choisis l explication qui correspond le mieux a pipe.
Bash question 16
Bash question 16. Choisis l explication qui correspond le mieux a for loop.
Bash question 17
Bash question 17. Choisis l explication qui correspond le mieux a echo output.
Bash question 18
Bash question 18. Choisis l explication qui correspond le mieux a variable assignment.
choix multiple
Bash question 1
Bash question 1. Choisis l explication qui correspond le mieux a echo output.
echo "$name"
reference
modeles pour script.sh
bash script.shpwd ls cd echo
Commands
name="Ada" echo "$name"
- Quote variables
- Start with echo
- Run in a small folder first
grep sort uniq wc
Pipes
printf "a\na\nb\n" | sort | uniq
- Pipe output to the next command
- Use rg or grep for search
- Count with wc
shebang variables if loops
Scripts
for file in *.txt; do echo "$file" done
- Use set -e for safer scripts
- Quote paths
- Dry run before deleting