Vous êtes sur la page 1sur 95

I-INTRODUCTION

II- TYPES DE SYSTÈMES D'EXPLOITATION


III- PRÉSENTATION DE LINUX
IV-SHELL OU TERMINAL

Chapitre 1: PRÉSENTATION GÉNÉRALE ET COMMANDE SHELL

Ghislain PANDRY/Guy Cédric TOA BI

Chercheur, Traitement du signal et des images/Enseignant-Chercheur en Sécurité

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION I-1 : Dénition d'un OS
III- PRÉSENTATION DE LINUX I-2 : Structure Générale d'un OS
IV-SHELL OU TERMINAL

I-1-1 : Dénition Générale


Le système d'exploitation est un ensemble de programmes qui
réalise l'interface entre le matériel de l'ordinateur et les utilisateurs.
Les objectifs principaux sont :
Contrôle des ressources (allocation et gestion du CPU et de la
mémoire),
Contrôle des processus,
Contrôle des périphériques

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION I-1 : Dénition d'un OS
III- PRÉSENTATION DE LINUX I-2 : Structure Générale d'un OS
IV-SHELL OU TERMINAL

I-1-2 : Protection des ressources


Le premier rôle principal du système d'exploitation dans un
environnement multiprogrammé que de gérer le partage de la
machine physique et des ressources matérielles (le processeur, la
mémoire centrale et les périphériques d'entrées-sorties) entre les
diérents programmes. Cette gestion doit assurer l'équité d'accès
aux ressources matérielles et assurer également que les accès des
programmes à ces ressources s'eectuent correctement, c'est-à-dire
que les opérations réalisées par les programmes sont licites pour la
cohérence des ressources.

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION I-1 : Dénition d'un OS
III- PRÉSENTATION DE LINUX I-2 : Structure Générale d'un OS
IV-SHELL OU TERMINAL

I-1-3 : Accessibilité des ressources


Faciliter l'accès à la machine physique constitue le second rôle du
système d'exploitation. Le système d'exploitation construit
au-dessus de la machine physique, une machine virtuelle plus simple
d'emploi et plus conviviale. Ainsi, pour réaliser une opération
d'entrées-sorties, l'utilisateur fait appel à une même primitive
ECRIRE(données) quel que soit le périphérique concerné. C'est la
primitive ECRIRE et la fonction de gestion des entrées-sorties du
système d'exploitation à laquelle cette primitive est rattachée qui
feront la liaison avec les caractéristiques matérielles.

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION I-1 : Dénition d'un OS
III- PRÉSENTATION DE LINUX I-2 : Structure Générale d'un OS
IV-SHELL OU TERMINAL

I-1-4 : Architecture

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION I-1 : Dénition d'un OS
III- PRÉSENTATION DE LINUX I-2 : Structure Générale d'un OS
IV-SHELL OU TERMINAL

I-2-1 : Fonctionnalité de gestion du processeur


Le système doit gérer l'allocation du processeur aux diérents
programmes pouvant s'exécuter. Cette allocation se fait par le biais
d'un algorithme d'ordonnancement qui planie l'exécution des
programmes. Dans ce cadre, une exécution de programme est
appelée processus.

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION I-1 : Dénition d'un OS
III- PRÉSENTATION DE LINUX I-2 : Structure Générale d'un OS
IV-SHELL OU TERMINAL

I-2-2 : Fonctionnalité de gestion des objets externes


La mémoire centrale est une mémoire volatile. Aussi, toutes les
données devant être conservées au-delà de l'arrêt de la machine,
doivent être stockées sur une mémoire de masse non volatile(disque
dur, USB, CD). La gestion de l'allocation des mémoires de masse
ainsi que l'accès aux données stockées s'appuient sur la notion de
chiers et de Système de Gestion de Fchiers (SGF).

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION I-1 : Dénition d'un OS
III- PRÉSENTATION DE LINUX I-2 : Structure Générale d'un OS
IV-SHELL OU TERMINAL

I-2-3 : Fonctionnalité de gestion des entrées-sorties


Le système doit gérer l'accès aux périphériques, c'est-à-dire faire la
liaison entre les appels de haut niveau des pro-grammes utilisateurs
et les opérations de bas niveau de l'unité d'échange responsable du
périphérique (unité d'échange clavier) : c'est le pilote
d'entrées-sorties (driver) qui assure cette correspondance.

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION I-1 : Dénition d'un OS
III- PRÉSENTATION DE LINUX I-2 : Structure Générale d'un OS
IV-SHELL OU TERMINAL

I-2-4 : Fonctionnalité de gestion de la mémoire


Le système doit gérer l'allocation de la mémoire centrale entre les
diérents programmes pouvant s'exécuter,c'est-à-dire qu'il doit
trouver une place libre susante en mémoire centrale pour que le
chargeur puisse y placer un programme à exécuter, en s'appuyant
sur les mécanismes matériels sous-jacents de segmentation et de
pagination. Comme la mémoire physique est souvent trop petite
pour contenir la totalité des programmes, la gestion de la mémoire
se fait selon le principe de la mémoire virtuelle : à un instant donné,
seules sont chargées en mémoire centrale, les parties de code et
données utiles à l'exécution.

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION I-1 : Dénition d'un OS
III- PRÉSENTATION DE LINUX I-2 : Structure Générale d'un OS
IV-SHELL OU TERMINAL

I-2-5 : Fonctionnalité de gestion de la mémoire


Le système doit gérer l'allocation de la mémoire centrale entre les
diérents programmes pouvant s'exécuter,c'est-à-dire qu'il doit
trouver une place libre susante en mémoire centrale pour que le
chargeur puisse y placer un programme à exécuter, en s'appuyant
sur les mécanismes matériels sous-jacents de segmentation et de
pagination. Comme la mémoire physique est souvent trop petite
pour contenir la totalité des programmes, la gestion de la mémoire
se fait selon le principe de la mémoire virtuelle : à un instant donné,
seules sont chargées en mémoire centrale, les parties de code et
données utiles à l'exécution.

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION I-1 : Dénition d'un OS
III- PRÉSENTATION DE LINUX I-2 : Structure Générale d'un OS
IV-SHELL OU TERMINAL

I-2-6 : Fonctionnalité de gestion de la concurrence


Plusieurs programmes coexistent en mémoire centrale, ceux-ci
peuvent vouloir communiquer pour échanger des données. Par
ailleurs, il faut synchroniser l'accès aux données partagées an de
maintenir leur cohérence. Le système ore des outils de
communication et de synchronisation entre processus.

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION I-1 : Dénition d'un OS
III- PRÉSENTATION DE LINUX I-2 : Structure Générale d'un OS
IV-SHELL OU TERMINAL

I-2-7 : Fonctionnalité de gestion de la protection


Le système doit fournir des mécanismes garantissant que ses
ressources (processeur, mémoire, chiers) ne peuvent être utilisées
que par les programmes auxquels les droits nécessaires ont été
accordés. Il faut notamment protéger le système et la machine des
programmes utilisateurs (mode d'exécution utilisateur et
superviseur).

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION I-1 : Dénition d'un OS
III- PRÉSENTATION DE LINUX I-2 : Structure Générale d'un OS
IV-SHELL OU TERMINAL

I-2-8 : Fonctionnalité de gestion de l'accès au réseau


Les exécutions de programmes placées sur des machines physiques
distinctes doivent pouvoir échanger des données. Le système
d'exploitation fournit des outils permettant aux applications
distantes de dialoguer à travers une couche de protocoles réseau
telle que TCP/IP.

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION I-1 : Dénition d'un OS
III- PRÉSENTATION DE LINUX I-2 : Structure Générale d'un OS
IV-SHELL OU TERMINAL

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION I-1 : Dénition d'un OS
III- PRÉSENTATION DE LINUX I-2 : Structure Générale d'un OS
IV-SHELL OU TERMINAL

I-2-9 : Types de communication avec les fonctionnalités


Le système d'exploitation s'interface avec les applications du niveau
utilisateur par le biais des fonctions prédénies que chacune de ses
fonctionnalités ore. Ces fonctions constituent les points d'entrées
des fonctionnalités du système d'exploitation et sont appelables
depuis les applications de niveau utilisateur. Ces appels peuvent se
faire à deux niveaux :
dans le code d'un programme utilisateur à l'aide d'un appel
système, qui n'est autre qu'une forme d'appel de procédure
amenant à l'exécution d'une routine système ;
depuis le prompt de l'interpréteur de commandes à l'aide d'une
commande. L'interpréteur de commandes est un outil de
niveau utilisateur qui accepte les commandes de l'utilisateur,
les analyse et lance l'exécution de la routine système associée.
Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE
I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION II-1 : Systèmes d'exploitation multiprogrammés
III- PRÉSENTATION DE LINUX II-2 : Systèmes interactifs
IV-SHELL OU TERMINAL

II-1-1 : Types systèmes d'exploitation multiprogrammés


Les systèmes d'exploitation multiprogrammés peuvent être classés
selon diérents types qui dépendent des buts et des services oerts
par les systèmes. Trois grandes classes de systèmes peuvent être
dénies :
les systèmes à traitements par lots ;
les systèmes multi-utilisateurs interactifs ;
les systèmes temps réels.

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION II-1 : Systèmes d'exploitation multiprogrammés
III- PRÉSENTATION DE LINUX II-2 : Systèmes interactifs
IV-SHELL OU TERMINAL

II-2-1 : Dénition
Un système d'exploitation interactif est que l'utilisateur de la
machine peut interagir avec l'exécution de son programme. le but
principal poursuivi par les systèmes interactifs va être d'orir pour
chaque exécution le plus petit temps de réponse possible. Le temps
de réponse d'une exécution est le temps écoulé entre le moment où
l'exécution est demandée par l'utilisateur et le moment où
l'exécution est achevée. Pour parvenir à ce but, la plupart des
systèmes interactifs travaillent en temps partagé.

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION II-1 : Systèmes d'exploitation multiprogrammés
III- PRÉSENTATION DE LINUX II-2 : Systèmes interactifs
IV-SHELL OU TERMINAL

II-2-2 : Système en temps partagé


Un système en temps partagé permet aux diérents utilisateurs de
partager l'ordinateur simultanément, tout en ayant par ailleurs la
sensation d'être seul à utiliser la machine. Ce principe repose
notamment sur un partage de l'utilisation du processeur par les
diérents programmes des diérents utilisateurs. Chaque
programme occupe à tour de rôle le processeur pour un court laps
de temps (le quantum) et les exécutions se succèdent susamment
rapidement sur le processeur pour que l'utilisateur ait l'impression
que son travail dispose seul du processeur.

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION II-1 : Systèmes d'exploitation multiprogrammés
III- PRÉSENTATION DE LINUX II-2 : Systèmes interactifs
IV-SHELL OU TERMINAL

TYPES DE OS
Unix : Linux, BDS, Solaris...
Windows : NT, 2000, XP...
MacOS < 10

AVANTAGES D'UNIX :
Stable, sûr (peu de virus) ;
Langage de commandes ;

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION III-1 : Structure de linux
III- PRÉSENTATION DE LINUX III-2 : Principe de fonctionnement
IV-SHELL OU TERMINAL

Développement du noyau Linux


Si au début de son histoire le développement du noyau Linux était
assuré par des développeurs bénévoles, les principaux contributeurs
sont aujourd'hui un ensemble d'entreprises, souvent concurrentes,
comme Red Hat, Novell, IBM ou Intel.
La licence du noyau Linux est la licence publique générale GNU.
Cette licence est libre, ce qui permet d'utiliser, copier et modier le
code source selon ses envies ou ses besoins. Ainsi, quiconque a les
connaissances nécessaires peut participer aux tests et à l'évolution
du noyau.

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION III-1 : Structure de linux
III- PRÉSENTATION DE LINUX III-2 : Principe de fonctionnement
IV-SHELL OU TERMINAL

Mode de numérotation
Les numéros de version du noyau sont composés de trois chires :
le premier est le numéro majeur, le second le numéro mineur. Avant
l'apparition des versions 2.6.x, les numéros mineurs pairs
indiquaient une version stable et les numéros mineurs impairs une
version de développement. Ainsi, les versions 2.2, 2.4 sont stables,
les versions 2.3 et 2.5 sont des versions de développement. Depuis
la version 2.6 du noyau, ce modèle de numérotation
stable/développement a été abandonné et il n'y a donc plus de
signication particulière aux numéros mineurs pairs ou impairs. Le
troisième chire indique une révision, ce qui correspond à des
corrections de bogues, de sécurité ou un ajout de fonctionnalité.
Exemple : 2.2.26, 2.4.30, 2.6.11 ou 2.6.32.

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION III-1 : Structure de linux
III- PRÉSENTATION DE LINUX III-2 : Principe de fonctionnement
IV-SHELL OU TERMINAL

PROJET GNU
Principe de base : le libre accès au code source accélère le progrès
en matière d'informatique car l'innovation dépend de la diusion du
code source.
La liberté au sens GNU est dénie selon quatre principes (le
copyleft GPL) :
liberté d'exécuter le programme, pour tous les usages ;
liberté d'étudier le fonctionnement du programme, de l'adapter
à ses besoins
liberté de redistribuer des copies
liberté d'améliorer le programme et de publier ses
améliorations, pour en faire proter toute la communauté

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION III-1 : Structure de linux
III- PRÉSENTATION DE LINUX III-2 : Principe de fonctionnement
IV-SHELL OU TERMINAL

La licence GPL (General Public licence)


Autorise l'utilisateur à copier et distribuer à volonté le logiciel
qu'elle protège, pourvu qu'il n'interdise pas à ses pairs de le
faire aussi,
Requiert aussi que tout dérivé d'un travail placé sous sa
protection soit lui aussi protégé par elle,
Quand la GPL évoque les logiciels libre, elle traite de liberté et
non de gratuité (un logiciel GPL peut être vendu),

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION III-1 : Structure de linux
III- PRÉSENTATION DE LINUX III-2 : Principe de fonctionnement
IV-SHELL OU TERMINAL

Distributions Linux
Une distribution est un noyau auquel des logiciels ont été ajoutés
pour créer des distributions dédiées à un usage particulier.
https://fr.wikipedia.org/wiki/Liste_des_distributions_
GNU/Linux
https://www.lemondeinformatique.fr/actualites/
lire-27-8-millions-de-lignes-de-code-pour-le-noyau-linux-au
html

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION III-1 : Structure de linux
III- PRÉSENTATION DE LINUX III-2 : Principe de fonctionnement
IV-SHELL OU TERMINAL

DÉFINITION DE NOYAU
Le noyau gère les tâches de base du système :
L'initialisation du système ;
La gestion des ressources ;
La gestion des processus ;
La gestion des chiers ;
La gestion des Entrées/Sorties.

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION III-1 : Structure de linux
III- PRÉSENTATION DE LINUX III-2 : Principe de fonctionnement
IV-SHELL OU TERMINAL

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION III-1 : Structure de linux
III- PRÉSENTATION DE LINUX III-2 : Principe de fonctionnement
IV-SHELL OU TERMINAL

1 Boot et lancement du noyau


2 Processus init
3 Services et démons
4 Les runlevels
5 Scripts de lancement des services

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION III-1 : Structure de linux
III- PRÉSENTATION DE LINUX III-2 : Principe de fonctionnement
IV-SHELL OU TERMINAL

Boot
Le lancement du système se fait en deux étapes : le boot et le
chargement du noyau.
Au boot le BIOS exécute le MBR (Master Boot Reccord) situé
sur le premier secteur (512 octets) du support bootable choisi
(disque, CD, clef USB, ...)
Le MBR :
scanne le disque pour trouver la partition bootable (ag)
lance le boot loader (chargeur de démarrage) du secteur de
boot (premier secteur) de la partition bootable

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION III-1 : Structure de linux
III- PRÉSENTATION DE LINUX III-2 : Principe de fonctionnement
IV-SHELL OU TERMINAL

Lancement du noyau
Le bootloader :
charge le noyau en mémoire et l'exécute
charge le ramdisk initrd.img en mémoire
2 bootloader possibles :
LILO (LInux LOader)
GRUB (GRand Unied Bootloader)

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION III-1 : Structure de linux
III- PRÉSENTATION DE LINUX III-2 : Principe de fonctionnement
IV-SHELL OU TERMINAL

Processus init
Lancement du système : boot − > init
Une fois le noyau chargé en mémoire, il lance le premier
processus : /bin/init
init est le père de tous les autres processus qui seront créés par
l'appel system fork()
init lit le chier /etc/inittab pour savoir :
quel est le chier à exécuter pour continuer le chargement du
système
quel est le runlevel (niveau d'exécution) par défaut
comment lancer les services pour un runlevel donné
···

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION III-1 : Structure de linux
III- PRÉSENTATION DE LINUX III-2 : Principe de fonctionnement
IV-SHELL OU TERMINAL

Services et démons
Lancement du système : boot − > init − > modules/services
Après le chargement du noyau, le script correspondant à sysinit
dans chier inittab est chargé :
Mandriva : /etc/rc.d/rc.sysinit
Debian : /etc/rc.d/rcS lance les scripts /etc/rcS.d/S ? ?*
Ce script d'initialisation est chargé de 2 tâches fondamentales :

charger les modules dans le noyau (gestion des périphériques)


démarrer les services en exécutant les processus Deferred
Auxiliary Executive Monitor (daemons) correspondant, en
français : démons

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION III-1 : Structure de linux
III- PRÉSENTATION DE LINUX III-2 : Principe de fonctionnement
IV-SHELL OU TERMINAL

RUNLEVELS
Lancement du système : boot − > init − > services

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


I-INTRODUCTION
II- TYPES DE SYSTÈMES D'EXPLOITATION III-1 : Structure de linux
III- PRÉSENTATION DE LINUX III-2 : Principe de fonctionnement
IV-SHELL OU TERMINAL

RUNLEVELS
Lancement du système : boot − > init − > services

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

OBJECTIFS : SHELL

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Exemple : TERMINAL PHYSIQUE

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Exemple 1 : TERMINAL PHYSIQUE

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Exemple 2 : SHELL OU TERMINAL VIRTUEL

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Dénition 1 :Shell

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Dénition 1 :Shell

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Propriétés du Shell Linux :


Interactive,
Exécution des programmes en arrière plan (non interactifs),
Redirection des E/S,
A un langage simple pour écrire des scripts,

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Utilité du Shell Linux :


Administrer.
Tuer des processus récalcitrants (Indisciplinés).
Sur une machine multiprocesseur, avoir une idée de son
occupation.
Automatiser des traitements massifs ou un même programme
doit être lancé des dizaines de fois.
Savoir se connecter à une machine Linux distante pour y
prendre ou mettre des chiers ainsi qu'y lancer des
programmes.

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Modes d'utilisation : SHELL

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Syntaxe d'une commande Shell

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

UN PROCESSUS COMMUNIQUE AVEC L'UTILISATEUR VIA UN


TERMINAL

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

TYPE : SHELL

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Le Bourne-Again Shell (bash)

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Le Bourne-Again Shell (bash)

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Le Texte Bourne-Again Shell (bash)

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Le Texte Bourne-Again Shell (bash)

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Le Texte Bourne-Again Shell (bash)

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

CARACTÈRES SPÉCIAUX

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

MOTS RÉSERVÉS

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

COMMANDES INTERNES (BUILTINS)

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

COMMANDES INTERNES (BUILTINS)

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

VARIABLES

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

VARIABLES : ASSIGNATION ET UTILISATION

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

VARIABLES : DESTRUCTION ET PROTECTION

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

PRÉCAUTION SUR LES VARIABLES

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

VALEURS NUMÉRIQUES ET VARIABLES

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

EXPORTATION DES VARIABLES :EXPORT

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

VARIABLES D'ENVIRONNEMENT

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

VARIABLES D'ENVIRONNEMENT :env

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

SUBSTITUTION DE VARIABLES

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

VARIABLES PRÉDÉFINIES

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

CARACTÈRES SPÉCIAUX

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

EXEMPLE

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Structure d'un script shell

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Variables de passage de paramètre à un script

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

EXEMPLE

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

REMARQUE

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Décalage de paramètres : shift

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

REMARQUE

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Commandes de test : test, [

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Commandes de test : test, [ (SUITE)

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

EXEMPLE

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Valeur de retour

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Listes de commandes

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Branchement conditionnel : if-then-elif-else-

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

EXEMPLE

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Opérateurs logiques du shell : &&, ||

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Branchement conditionnel : case-esac

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

EXEMPLE

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Boucle for-do-done

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

EXEMPLE

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Boucle while-do-done

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Boucle until-do-done

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Contrôle du ux d'exécution : break, continue

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Fonction

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Code de retour : return, exit

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Gestion des signaux : trap, kill

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Calculs numériques : expr

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Manipulation d'arguments : xargs OPTIONS commande

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE


IV-1 : Introduction
I-INTRODUCTION IV-2 : Commandes
II- TYPES DE SYSTÈMES D'EXPLOITATION IV-3 : Variables
III- PRÉSENTATION DE LINUX IV-4 : Rôle d'un script shell
IV-SHELL OU TERMINAL IV-5 : Test
IV-6 : Structures de contrôle
IV-7 : Fichiers d'initialisation

Ghislain PANDRY/Guy Cédric TOA BI Chapitre 1: PRÉSENTATION GÉNÉRALE

Vous aimerez peut-être aussi