Partie II : Programmation shell

Programmation shell : plan (1)

Programmation shell : plan (2)

Programmation shell : plan (3)

Programmation shell : plan (4)

Programmation shell : plan (5)

Programmation shell : plan (6)

Introduction

Scripts shell

Contenu d'un script shell

Variables et paramètres (1)

Variables et paramètres (2)

Exemple de script (1)

Exemple de script (2)

Exécution d'un script shell

Sortie d'un script shell

Exercices I.1

Variables, paramètres et substitutions

Variables de shell

Exemples de variables de shell

Variables et substitutions

Variables et lecture de valeurs

Variables et affectations

Exercices II.1

Structures de contrôle

Structures de contrôle

Groupage de commandes

La commande if (1)

La commande if (2)

La commande test (1)

La commande test (2)

La commande test (3)

La commande test (4)

Exercices III.1

La commande case (1)

La commande case (2)

Exercices III.2

La commande for (1)

La commande for (2)

Exercices III.3

La commande seq

La commande while

La commande until

La commande break

La commande continue

Structures de contrôle et redirections

Exercices III.4

Les fonctions

Les fonctions (1)

Les fonctions (2)

Les fonctions (3)

Les fonctions (4)

Exercices IV.1

Commandes utiles

La commande expr (1)

La commande expr (2)

  • expr substr chaine i n Affiche la sous-chaîne de chaine de longueur n et commençant au caractère à l'indice i (le premier caractère est à l'indice 1)
  • expr index chaine caractère Affiche l'indice de la première occurence de caractère dans chaine, ou 0 si caractère n'est pas présent dans chaine
  • expr length chaine Affiche la longueur de chaine

    Arithmétique entière

  • Calcul (et substitution) arithmétique :

    La commande eval (1)

    La commande eval (2)

    La commande exec

    La commande getopts

    La commande select

    Exercices V.1

    Mini-projets

    Gestion de sauvegardes

    Gestion d'une poubelle

    Un mécanisme d'annulation (1)

    Un mécanisme d'annulation (2)