diff --git a/.markdownlint.json b/.markdownlint.json index 8f2b9a1..fa671d5 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -4,6 +4,7 @@ "MD013": false, "MD014": false, "MD024": false, + "MD025": false, "MD028": false, "MD033": false } \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3e1ddaa --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +OUTPUT_DIR = output + +.PHONY: site +site: + mkdir -p $(OUTPUT_DIR) + find . -name '*.md' -type f -print0 | xargs -0 -I {} sh -c \ + 'mkdir -p $(OUTPUT_DIR)/$$(dirname $${1#./}); \ + pandoc -s -f markdown -t html5 --template=template/template.html \ + --toc --toc-depth=2 --css=style.css -o $(OUTPUT_DIR)/$${1%.md}.html {}' -- {} + cp -r images $(OUTPUT_DIR) + find $(OUTPUT_DIR) -type f -name '*.html' -print0 | xargs -0 -I {} \ + sed -i -e 's/\.md/.html/g' {} + find $(OUTPUT_DIR) -type d -print0 | xargs -0 -I {} sh -c \ + 'cp template/style.css {}' -- {} diff --git a/README.md b/README.md index 5e547f0..e2b4277 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ -cours-unix-shell -=============== +--- +title: Cours UNIX Shell +--- + +# cours-unix-shell Reprise d'un [ancien cours UNIX/Shell](./UnixShell_cours2018/), dédié à des formations internes pour diff --git a/bases/tp.md b/bases/tp.md index 976f947..4e2eea6 100644 --- a/bases/tp.md +++ b/bases/tp.md @@ -87,6 +87,7 @@ ``` + - avec un pipe pour enchaîner les deux commandes appropriées
Voir la solution @@ -96,6 +97,7 @@ ```
+ - Renommez le fichier historique.txt en monHistorique.txt
Voir la solution diff --git a/images/Make.gif b/images/Make.gif new file mode 100644 index 0000000..3f48c45 --- /dev/null +++ b/images/Make.gif Binary files differ diff --git a/images/Shell.gif b/images/Shell.gif new file mode 100644 index 0000000..a5669f0 --- /dev/null +++ b/images/Shell.gif Binary files differ diff --git a/make/README.md b/make/README.md index 1564859..35679dc 100644 --- a/make/README.md +++ b/make/README.md @@ -1,3 +1,7 @@ +--- +title: Make - UNIX +--- + # Make - UNIX GNU Make est un héritier de `make`, mais sous Linux, c'est bien GNU Make qui est @@ -8,11 +12,11 @@ Un shell fait tous les traitements qui y sont indiqués. -![Un shell fait tous les traitements qui y sont indiqués](../UnixShell_cours2018/Shell.gif) +![Un shell fait tous les traitements qui y sont indiqués](../images/Shell.gif) Un make ne fait que les traitements qui sont nécessaires. -![Un make ne fait que les traitements qui sont nécessaires](../UnixShell_cours2018/Make.gif) +![Un make ne fait que les traitements qui sont nécessaires](../images/Make.gif) ## Syntaxe diff --git a/output/README.html b/output/README.html new file mode 100644 index 0000000..96ebdcf --- /dev/null +++ b/output/README.html @@ -0,0 +1,45 @@ + + + + + Cours UNIX Shell + + + + +
+

Cours UNIX Shell

+ +
+ +
+

cours-unix-shell

+

Reprise d'un ancien cours UNIX/Shell, dédié à des formations internes pour l'Inist-CNRS.

+

Il dérive de versions plus anciennes, légèrement modifiées avec le temps, dont l'origine remonte à 2004. Leurs auteurs sont François Parmentier et Philippe Houdry.

+

Il aborde des principes généraux, des commandes de base et une initiation à la programmation en shell UNIX. Chaque partie comprend un cours et un TP.

+
    +
  1. UNIX: présentation des caractéristiques, de l'historique d'Unix et du cas particulier de Linux,
  2. +
  3. bases: redirections et commandes de base à connaître,
  4. +
  5. commandes: diverses commandes UNIX utiles,
  6. +
  7. shell: initiation pour la programmation de scripts shell,
  8. +
  9. sed: substitution de textes via l'éditeur de chaînes de caractères non interactif.
  10. +
  11. make: outil qui fait gagner du temps en ne réitérant pas des calculs qui ne sont plus nécessaires.
  12. +
+
+ + + + + \ No newline at end of file diff --git a/output/bases/README.html b/output/bases/README.html new file mode 100644 index 0000000..4791ef3 --- /dev/null +++ b/output/bases/README.html @@ -0,0 +1,115 @@ + + + + + + + + + +
+

+ +
+ +
+

Redirections et Pipes

+

Redirections

+

Accès en lecture par redirection de l'entrée

+
+ entrée et sortie standard d'une commande Unix
entrée et sortie standard d'une commande Unix
+
+

Entrées sorties standard

+

Toute commande Unix peut utiliser :

+ +

Valeurs implicites (pour un poste de travail) :

+ +

Redirection de l'entrée standard vers un fichier

+
+ redirection de l'entrée standard d'une commande unix
redirection de l'entrée standard d'une commande unix
+
+

Soit :

+ +

La commande shell suivante : aUnixCommand < myFile

+

appliquera le programme aUnixCommand au fichier myFile et affichera le résultat sur l'écran.

+

Redirections et quelques commandes Unix

+

cat

+

Utilisée sans paramètres, recopie le fichier en entrée sur la sortie standard :

+
cat < Formation/TP1/exo.txt
+

recopie sur l'écran le fichier Formation/TP1/exo.txt.

+

cat - avec paramètres

+

La commande cat peut s'utiliser avec une liste de fichiers en paramètres.
+ Ainsi :

+
cat Formation/TP1/exo1.txt Formation/TP1/exo2.txt
+

"concatène" les fichiers sur stdout.

+
+

À NOTER : avec un seul fichier les commandes :

+
cat Formation/TP1/exo.txt
+

et

+
cat < Formation/TP1/exo.txt
+

peuvent être considérées comme équivalentes.

+
+

sort

+

Trie les lignes d'un fichier dans l'ordre lexicographique ASCII.

+

Exemple :

+
sort < Formation/TP1/table.txt
+

grep

+

Sélectionne les lignes qui contiennent une expression donnée en paramètre.
+ Syntaxe simplifiée :

+
grep expression < file
+

Exemple :

+
grep 152X < Formation/TP1/issn.txt
+ +

Syntaxe simplifiée :

+
head [ -number ] < file
+ +

Exemple :

+
head -5 < Formation/TP1/file.xml
+

Redirection de la sortie standard vers un fichier

+

La sortie standard peut à son tour être redirigée vers un fichier.
+ 2 possibilités :

+
commande > fichier
+

le résultat de la commande va servir à créer ou à remplacer (par écrasement) le contenu du fichier donné.

+
commande >> fichier
+

le résultat de la commande va servir à créer (la première fois) ou à rallonger le contenu du fichier donné (concaténation).

+

Combinaison simple des redirections

+

Entrée et sortie standard peuvent être rédirigées simultanément.
+ Ainsi :

+
cat < fA > fB
+

copie le contenu du fichier fA pour créer le fichier fB.

+

Combinaison de fitres en cascade - le pipe

+

(image manquante)pipe de deux commandes unix

+

Le mécanisme appelé pipe permet d'enchaîner des commandes en affectant la sortie de l'une à l'entrée de la suivante. Sa forme générale est :

+
c0 < fA | c1 | c2 | ... | cn > fB
+

Le fichier fA est lu et traité par la commande c0, le résultat est alors traité par c1, et ainsi de suite jusqu'à la commande cn pour laquelle le résultat est écrit dans le fichier fB.

+

Précédent - Suivant

+
+ + + + + \ No newline at end of file diff --git a/output/bases/commandes-basiques.html b/output/bases/commandes-basiques.html new file mode 100644 index 0000000..3a21303 --- /dev/null +++ b/output/bases/commandes-basiques.html @@ -0,0 +1,185 @@ + + + + + + + + + +
+

+ +
+ +
+

Commandes de base UNIX

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
nomsyntaxedéfinitionexemple
catcat [file]Lecture du contenu de fichierscat file.txt
catcat [file]... cat < ... >...Concaténation de fichierscat file1.txt file2.txt > file3.txt
cdcd [newWD]Changement de working directory. À utiliser avec modération, penser aux chemins relatifscd Formation/TP1, cd, cd -
cpcp inputFile targetFileCopie d'un fichiercp exo.sh exo1.sh
datedateAffichage date et heure systèmedate
grepgrep expr <...Sélection des lignes contenant l'expression indiquéegrep "<dc:creator>" < file.xml
headhead [-n]Sélection du début d'un fichier (en nombre de lignes)head -1 < table.txt
historyhistory [-n]Historique des commandeshistory -50
lsls directoryListing du contenu d'un répertoirels Formation, ls Formation/TP1
mkdirmkdir dirNameCréation un répertoire (directory)mkdir Formation/TP2
moremore fileNameLecture à l'écran de fichiers texte (surtout longs)more table.txt
mvmv inputFile targetFileDéplacement (ou renommage) d'un fichiermv table.tmp table.txt
pwdpwdAffichage du working directorypwd
rmrm pathEffacement d'un fichierrm file.txt, rm Formation/TP1/table.tmp
rm\rm pathEffacement d'un fichier (en ignorant la confirmation avant chaque destruction)\rm file.txt
rmrm -r pathEffacement récursif d'un répertoirerm -r TP2/*.tmp
rmdirrmdir pathEffacement d'un répertoire (il doit être vide)rmdir TP3
sortsort < ... >...Tri du flot d'entréecat file1.txt file2.txt \| sort > file3.txt
tailtail [-n]Sélection de la fin d'un fichier (en nombre de lignes)tail -1 < table.txt
typetype commandDonne le type de la commande (alias, exécutable, etc.) et précise sa nature.type ll
wcwc [fileName]Affichage de la taille d'un fichier (nombre de caractères, de mots, de lignes)wc -l < file.xml
whichwhich commandRenvoie le chemin de la commande qui est exécutée quand on tape son nom dans le shellwhich ls
+

Précédent - Suivant

+
+ + + + + \ No newline at end of file diff --git a/output/bases/style.css b/output/bases/style.css new file mode 100644 index 0000000..b24537d --- /dev/null +++ b/output/bases/style.css @@ -0,0 +1 @@ +@import url(//fonts.googleapis.com/css?family=Libre+Baskerville:400,400italic,700);@import url(//fonts.googleapis.com/css?family=Source+Code+Pro:400,400italic,700,700italic);/* normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}body,code,tr.odd,tr.even,figure{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAABOFBMVEWDg4NycnJnZ2ebm5tjY2OgoKCurq5lZWWoqKiKiopmZmahoaGOjo5TU1N6enp7e3uRkZGJiYmFhYWxsbFOTk6Xl5eBgYGkpKRhYWFRUVGvr69dXV2wsLBiYmKnp6dUVFR5eXmdnZ1sbGxYWFh2dnZ0dHSmpqaZmZlVVVVqamqsrKyCgoJ3d3dubm5fX19tbW2ioqKSkpJWVlaHh4epqalSUlKTk5OVlZWysrJoaGhzc3N+fn5wcHBaWlqcnJxkZGRpaWlvb2+zs7NcXFxPT09/f3+lpaWWlpaQkJCjo6OIiIitra2enp6YmJhQUFBZWVmqqqqLi4uNjY1eXl6rq6ufn599fX2AgIB8fHyEhIRxcXFra2tbW1uPj4+MjIyGhoaamppgYGB4eHhNTU1XV1d1dXW0tLSUlJSHWuNDAAAAaHRSTlMNDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDUnKohIAA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FqsJwT9tWhChzL/IP/gxfleLSIgVQDdRvKBZVfu9wgKkeHEEfgIqa/F6fJ0HM8knJtkbCn4hKFvNDLWXDr8BGMywGD1Lh54AAAAASUVORK5CYII=")}body{font-family:"Libre Baskerville",Baskerville,Georgia,serif;background-color:#f8f8f8;color:#111;line-height:1.3;text-align:justify;-moz-hyphens:auto;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}@media (max-width: 400px){body{font-size:12px;margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:15px}}@media (min-width: 401px) and (max-width: 600px){body{font-size:14px;margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:15px}}@media (min-width: 601px) and (max-width: 900px){body{font-size:15px;margin-left:100px;margin-right:100px;margin-top:20px;margin-bottom:25px}}@media (min-width: 901px) and (max-width: 1800px){body{font-size:17px;margin-left:200px;margin-right:200px;margin-top:30px;margin-bottom:25px;max-width:800px}}@media (min-width: 1801px){body{font-size:18px;margin-left:20%;margin-right:20%;margin-top:30px;margin-bottom:25px;max-width:1000px}}p{margin-top:10px;margin-bottom:18px}em{font-style:italic}strong{font-weight:bold}h1,h2,h3,h4,h5,h6{font-weight:bold;padding-top:0.25em;margin-bottom:0.15em}header{line-height:2.475em;padding-bottom:0.7em;border-bottom:1px solid #bbb;margin-bottom:1.2em}header>h1{border:none;padding:0;margin:0;font-size:225%}header>h2{border:none;padding:0;margin:0;font-style:normal;font-size:175%}header>h3{padding:0;margin:0;font-size:125%;font-style:italic}header+h1{border-top:none;padding-top:0px}h1{border-top:1px solid #bbb;padding-top:15px;font-size:150%;margin-bottom:10px}h1:first-of-type{border:none}h2{font-size:125%;font-style:italic}h3{font-size:105%;font-style:italic}hr{border:0px;border-top:1px solid #bbb;width:100%;height:0px}hr+h1{border-top:none;padding-top:0px}ul,ol{font-size:90%;margin-top:10px;margin-bottom:15px;padding-left:30px}ul{list-style:circle}ol{list-style:decimal}ul ul,ol ol,ul ol,ol ul{font-size:inherit}li{margin-top:5px;margin-bottom:7px}q,blockquote,dd{font-style:italic;font-size:90%}blockquote,dd{quotes:none;border-left:0.35em #bbb solid;padding-left:1.15em;margin:0 1.5em 0 0}blockquote blockquote,dd blockquote,blockquote dd,dd dd,ol blockquote,ol dd,ul blockquote,ul dd,blockquote ol,dd ol,blockquote ul,dd ul{font-size:inherit}a,a:link,a:visited,a:hover{color:inherit;text-decoration:none;border-bottom:1px dashed #111}a:hover,a:link:hover,a:visited:hover,a:hover:hover{border-bottom-style:solid}a.footnoteRef,a:link.footnoteRef,a:visited.footnoteRef,a:hover.footnoteRef{border-bottom:none;color:#666}code{font-family:"Source Code Pro","Consolas","Monaco",monospace;font-size:85%;background-color:#ddd;border:1px solid #bbb;padding:0px 0.15em 0px 0.15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}pre{margin-right:1.5em;display:block}pre>code{display:block;font-size:70%;padding:10px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;overflow-x:auto}blockquote pre,dd pre,ul pre,ol pre{margin-left:0;margin-right:0}blockquote pre>code,dd pre>code,ul pre>code,ol pre>code{font-size:77.77778%}caption,figcaption{font-size:80%;font-style:italic;text-align:right;margin-bottom:5px}caption:empty,figcaption:empty{display:none}table{width:100%;margin-top:1em;margin-bottom:1em}table+h1{border-top:none}tr td,tr th{padding:0.2em 0.7em}tr.header{border-top:1px solid #222;border-bottom:1px solid #222;font-weight:700}tr.odd{background-color:#eee}tr.even{background-color:#ccc}tbody:last-child{border-bottom:1px solid #222}dt{font-weight:700}dt:after{font-weight:normal;content:":"}dd{margin-bottom:10px}figure{margin:1.3em 0 1.3em 0;text-align:center;padding:0px;width:100%;background-color:#ddd;border:1px solid #bbb;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;overflow:hidden}img{display:block;margin:0px auto;padding:0px;max-width:100%}figcaption{margin:5px 10px 5px 30px}.footnotes{color:#666;font-size:70%;font-style:italic}.footnotes li p:last-child a:last-child{border-bottom:none} diff --git a/output/bases/tp.html b/output/bases/tp.html new file mode 100644 index 0000000..815dd5c --- /dev/null +++ b/output/bases/tp.html @@ -0,0 +1,91 @@ + + + + + + + + + +
+

+ +
+ +
+

Travaux pratiques (commandes de base)

+

L'objectif de cette première session de TP est de préparer votre environnement de travail en même temps que de réviser rapidement quelques notions de base.

+

Préparation de votre environnement de travail

+ +

- Déplacez-vous dans le répertoire UnixShell en une étape et vérifiez le répertoire courant.
Voir la solution

+
```bash
+        $ cd Formation/UnixShell
+        $ pwd
+        / ... /Formation/UnixShell
+        ```
+

+

Utilisation de quelques commandes Unix de base

+ +

- Récupérez votre historique dans un fichier historique.txt.

Voir la solution

+
```bash
+        history > historique.txt
+        ```
+

- Affichez à l'écran le contenu de ce fichier historique.txt.
Voir la solution

+
```bash
+        more historique.txt
+        ```
+

- Comptez le nombre de lignes de ce fichier.
Voir la solution

+
```bash
+        $ wc -l historique.txt
+        16 historique.txt (par exemple)
+        ```
+

- Affichez les 3 premières lignes du fichier historique de deux façons : - avec une redirection en entrée de la commande appropriée
Voir la solution

+
  ```bash
+          head -3 < historique.txt
+          ```
+        
+          </details>
+ +

+

Précédent - Suivant

+ + + + + + \ No newline at end of file diff --git a/output/commandes/README.html b/output/commandes/README.html new file mode 100644 index 0000000..a5aa274 --- /dev/null +++ b/output/commandes/README.html @@ -0,0 +1,179 @@ + + + + + + + + + +
+

+ +
+ +
+

Autres commandes UNIX

+

Manuels en ligne

+

man

+

Cette commande permet d'obtenir le manuel unix en ligne de toute commande unix :

+
man [unixCommand]
+

Par exemple, on obtient l'aide en ligne (en anglais) sur la commande ls avec :

+
man ls
+

L'aide qui s'affiche se décompose en plusieurs parties, généralement (mais pas exclusivement) :

+ +

N'oubliez jamais de consulter le man quand vous voulez en connaître plus sur une commande, une fonction C, ou n'importe quoi d'autre (essayez man colors (obsolète)).

+
+

💡 Les mans ont évolué jusqu'à ne presque plus contenir d'exemples, les rendant beaucoup plus hermétiques.
+ Utilisez tldr pour avoir les exemples principaux pour une commande: https://tldr.sh/

+
+

Commandes sur les fichiers

+

find

+

Cette commande permet de rechercher un fichier ou un groupe de fichiers dans une arborescence unix. La recherche peut porter sur le nom du fichier, son propriétaire ou un groupe d'utilisateurs (ou bien d'autres critères, voir le man).

+

Pour retrouver un fichier par son nom ou par un masque (pattern) de celui-ci à partir du répertoire courant :

+
find . -name table*
+

Pour retrouver un (des) fichier(s) appartenant à un utilisateur particulier ou à un groupe particulier :

+
find . -user parmentf
+        find . -group dilib
+

Pour afficher la hiérarchie du répertoire courant :

+
find .
+

diff

+

Cette commande permet de comparer deux fichiers File1 et File2 et d'afficher leurs différences éventuelles, ligne à ligne.

+
diff File1 File2
+

La commande diff signale les différences qu'elle trouve à l'aide des codes suivants :

+ +

À titre d'illustration, soient les fichiers File1, File2 et File3 suivants :

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
File1File2File3
aaa
bb1
ccb
de
+

Les commandes diff qui suivent donneront pour rapports :

+
$ diff File1 File2
+        3a4
+        > d
+        $ diff File2 File1
+        4d3
+        < d
+        $ diff File1 File3
+        1a2
+        > 1
+        3c4
+        < c
+        ---
+        > e
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LigneFile1File2File3
1aaa
2bb1
3ccb
4de
+

L'option -c de la commande diff permet d'avoir un rapport plus lisible, notamment dans le cas de comparaison de gros fichiers.

+

Commandes sur les contenus

+

cut

+

Cette commande permet de récupérer une ou plusieurs parties d'une chaîne de caractères, par exemple en précisant le délimiteur séparant les parties à extraire.

+

Pour récupérer le numéro de département d'un code postal :

+
$ echo 54500 | cut -c1-2
+        54
+

Pour récupérer une partie d'une ligne avec un délimiteur, avec une variable ligne="auteur,titre,descripteurs,id" :

+
$ echo $ligne | cut -d, -f2,4
+        titre,id
+

À noter que si le délimiteur est un caractère spécial du shell, par exemple le pipe | ou le point-virgule, il faut le protéger entre guillemets.

+
$ echo $ligne | cut -d"|" -f2
+        titre
+

sed

+

Sed (pour Stream EDitor) est un éditeur non interactif de texte.
+ Il permet d'appliquer une certain nombre de commandes à un fichier puis d'en afficher le résultat (sans modifier le fichier de départ) sur la sortie standard.
+ Comme avec toute commande unix, il est possible de rediriger la sortie vers un fichier résultat.

+

Voir Sed.

+

Précédent - Suivant

+
+ + + + + \ No newline at end of file diff --git a/output/commandes/compression.html b/output/commandes/compression.html new file mode 100644 index 0000000..c16012b --- /dev/null +++ b/output/commandes/compression.html @@ -0,0 +1,75 @@ + + + + + + + + + +
+

+ +
+ +
+

Archives, compression, décompression

+

tar

+

Cette commande permet de créer un fichier archive (appelé tarfile) qui peut contenir des fichiers et répertoires.
+ Ce fichier tarfile n'est pas compressé.
+ Cette commande peut être utile pour archiver un répertoire et tout ce qu'il contient en un seul fichier.

+
tar -cvf Archives.tar Sauvegarde
+

La commande ci-dessus, avec les paramètres -cvf, permet de créer une archive du répertoire Sauvegarde dans le fichier nommé Archives.tar. Attention à l'ordre des deux derniers paramètres.

+
tar -xvf Archives.tar
+

La même commande tar avec les paramètres -xvf, permet de désarchiver le contenu du tarfile.
+ Attention au positionnement du désarchivage : il s'opère dans le répertoire courant.

+

Pour connaître le détail du contenu d'un tarfile, il faut utiliser les paramètres -tvf.

+

gzip

+

Cette commande permet de compresser un fichier afin d'en réduire la taille, pour stockage ou échange.
+ Le fichier résultat est renommé par ajout de l'extension .gz :

+
gzip corpus.xml
+

Par listing du contenu du répertoire où la compression a été réalisée, on peut voir que le fichier corpus.xml a disparu et a été remplacé par corpus.xml.gz.

+

Il est possible d'obtenir la taille d'un fichier non compressé à partir de son fichier compressé en gzip.

+
gzip -l corpus.xml.gz
+

Quatre informations sont alors affichées à l'écran :

+
    +
  1. la taille en octets du fichier compressé
  2. +
  3. la taille en octets du fichier non compressé
  4. +
  5. le ratio de compression
  6. +
  7. le nom du fichier initial, non compressé
  8. +
+
compressed uncompr. ratio uncompressed_name
+        77366      370713   79.1% corpus.xml
+

gunzip

+

Cette commande permet de décompresser un fichier compressé en .gz.
+ Sans paramètres, le fichier est décompressé sur disque et renommé sans l'extension .gz.
+ Attention, la place en octets prise correspond bien au fichier décompressé.
+ Cette commande est équivalente à gzip -d.

+
gunzip corpus.xml.gz
+

La commande ci-dessus restaure le fichier corpus.xml, qui remplace dans le répertoire courant l'ancien fichier corpus.xml.gz de plus petite taille.

+

S'il faut travailler avec un fichier compressé sans le décompresser sur disque, il faut alors qu'il soit seulement décompressé vers la sortie standard.
+ Ensuite, il suffira d'enchaîner les commandes requises avec des pipes.
+ Par exemple :

+
gunzip -c corpus.xml.gz | wc -l
+

zcat

+

Cette commande est équivalente à gunzip -c.

+
zcat corpus.xml.gz | wc -l
+

Précédent - Suivant

+
+ + + + + \ No newline at end of file diff --git a/output/commandes/droits.html b/output/commandes/droits.html new file mode 100644 index 0000000..80aa22c --- /dev/null +++ b/output/commandes/droits.html @@ -0,0 +1,158 @@ + + + + + + + + + +
+

+ +
+ +
+

Gestion des droits

+

ll (alias de ls -alF)

+

Cette commande permet d'obtenir la description complète d'un répertoire, y compris les fichiers et répertoires cachés (qui commencent par un point) :

+
ll
+

L'affichage résultant se lit ligne par ligne, par exemple :

+
drwxrwxr-x  3 houdry   dps   1024 Apr 28 15:28 ./
+        drwxr-xr-x 16 houdry   dps    512 Apr 18 16:19 ../
+        -rw-rw-r--  1 parmentf dilib 2848 Apr 25 11:08 Make.gif
+        -rw-rw-r--  1 parmentf dilib 2631 Apr 25 11:08 Shell.gif
+        -rw-rw-r--  1 houdry   dps   7817 Apr 25 11:44 redirPipes.html
+        -rw-rw-r--  1 parmentf dilib 2405 Apr 24 17:36 make.html
+        -rwxrwxr--  1 houdry   dps    235 Apr 24 17:01 exotp.sh*
+

De nombreux éléments d'information sont visibles avec une commande de listing long. Ils sont au nombre de sept, avec dans l'ordre des colonnes :

+ +
+

💡 l'option -h vous donnera la taille de l'entrée dans un format plus... humain.

+
+

who, whoami, id

+

Un utilisateur unix est identifié par deux choses :

+
    +
  1. son code utilisateur (ex.: parmentf ou houdry)
  2. +
  3. son ou ses groupes (ex.: dps)
  4. +
+

Différentes commandes permettent de retrouver ces informations.

+

Identification de l'utilisateur courant :

+
whoami
+

Identification des utilisateurs du système :

+
who
+

Affichage des code et groupe de l'utilisateur :

+
id
+

umask

+

Cette commande permet de paramétrer les droits rwx qui vont servir pour la création des nouveaux fichiers. Deux syntaxes sont possibles, celles qui suivent sont équivalentes et standard :

+
umask a=rx,ug+w
+        umask 002
+

Les droits des 3 entités propriétaire (u), groupe du propriétaire (g) et autres groupes (o) doivent être précisés :

+ +

chmod

+

Cette commande permet de modifier les droits d'un fichier ou d'un répertoire.
+ Pour pouvoir le faire, il faut en être propriétaire.
+ Là aussi, il y a deux façons d'utiliser cette commande : avec les groupes ugoa et les droits rwx ou bien avec un profil octal (directement, sans prendre sa négation comme avec umask).
+ Le tableau suivant résume les cas possibles :

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lettresbinaireoctal
---0000
--x0011
-w-0102
-wx0113
r--1004
r-x1015
rw-1106
rwx1117
+

Par exemple, pour positionner les droits d'un fichier File à rwxr-xr-- :

+
chmod 754 [File]
+        chmod u=rwx,g=rx,o=r [File]
+

Pour modifier des droits positionnés à r--r----x en rwxrw-r--, on peut aussi écrire :

+
chmod ug+w,u+x,a+r,o-x [File]
+

chgrp

+

Cette commande permet de changer le groupe attaché à un fichier ou à un répertoire.
+ Par exemple, un fichier File est lié au groupe dps et il faut le changer pour le lier au groupe dilib (attention, il faut que le user appartienne aux deux groupes) :

+
chgrp veille [File]
+

newgrp

+

Cette commande permet de changer le groupe d'appartenance de l'utilisateur.
+ Cela peut être nécessaire pour accéder à des fichiers dont l'emploi est limité à certains groupes (par ex., dilib par rapport à dps).
+ Pour changer de groupe, il faut appartenir aux deux (l'ancien et le nouveau).

+

À partir du moment où cette commande est lancée, les fichiers et répertoires créés le seront sous ce nouveau groupe.

+
newgrp veille
+

Précédent - Suivant

+
+ + + + + \ No newline at end of file diff --git a/output/commandes/processus.html b/output/commandes/processus.html new file mode 100644 index 0000000..9c1bcdf --- /dev/null +++ b/output/commandes/processus.html @@ -0,0 +1,64 @@ + + + + + + + + + +
+

+ +
+ +
+

Gestion des processus

+

ps

+

Cette commande permet de voir quels sont les processus actifs pour un terminal donné.
+ Les processus qui sont vus ici sont par exemple le shell actif ou tout programme en train de s'exécuter.

+
ps
+

L'appel de cette commande affiche la liste des processus actifs avec, en particulier, leurs numéros (dits PID).

+
   PID TTY      TIME CMD
+          8073 pts/29   0:01 ksh
+         12395 pts/29   0:25 xemacs
+

kill

+

Cette commande permet, en particulier, de détruire un processus qui ne s'est pas normalement terminé avec l'achèvement d'un traitement et qui continue d'être visible par un ps ou un top.
+ Pour faire cela, il faut utiliser le paramètre -9 de la commande suivi du numéro PID du processus à arrêter.

+
kill -9 10256
+

nice

+

Cette commande permet d'altérer délibérément la priorité d'une commande pour ne pas gêner l'exécution de tâches plus prioritaires.
+ Par exemple :

+
nice top
+

top

+

Cette commande affiche les processus les plus actifs (top CPU), avec réactualisation fréquente des informations (par défaut, toutes les 3 secondes).

+
top
+

Sont ainsi obtenus les noms des commandes et leur PID respectifs ainsi, entre autres, que le nom du propriétaire de chacun de ces processus, leur priorité ou leur charge CPU.
+ L'état affiché concerne l'ensemble des utilisateurs unix de la machine.

+

Il y a une ligne de saisie de commandes juste au-dessus de la liste des 15 processus, à la position du curseur. Plusieurs commandes peuvent être utilisées ici, dont par exemple :

+ +

Précédent - Suivant

+
+ + + + + \ No newline at end of file diff --git a/output/commandes/style.css b/output/commandes/style.css new file mode 100644 index 0000000..b24537d --- /dev/null +++ b/output/commandes/style.css @@ -0,0 +1 @@ +@import url(//fonts.googleapis.com/css?family=Libre+Baskerville:400,400italic,700);@import url(//fonts.googleapis.com/css?family=Source+Code+Pro:400,400italic,700,700italic);/* normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}body,code,tr.odd,tr.even,figure{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAABOFBMVEWDg4NycnJnZ2ebm5tjY2OgoKCurq5lZWWoqKiKiopmZmahoaGOjo5TU1N6enp7e3uRkZGJiYmFhYWxsbFOTk6Xl5eBgYGkpKRhYWFRUVGvr69dXV2wsLBiYmKnp6dUVFR5eXmdnZ1sbGxYWFh2dnZ0dHSmpq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oECLq+XXLs4w8U+DUZyir9Cw+XL3rHFGoDNI9Rw3baFy/fZwTY2Gr0WMuLaxMrWaC5rh+IeyZijp0fdaDLPg8YtugLgnwYZss1xIh1o13qB7L8pC6wEutNQVuy5aIpNkSSl2yWAiRADUVXSMqpTH8Da3gCNr8maodNIxjY7CXyvzHHfiJoto/CE9UMmX+cRqPC8RKdks7OV35txMGkdXzOkkhX9wTr+tIOGKZzjoo+qbWy3hsJJtz5D7nP+syyjxYe7eCAMIOywwFNfv/ZMNyBSxV0g7ZEJCPVE8IA5sw7jg9Kx3RXdfCQXGxpH+0kyHYpBj0H4y2VdAHRW9RyegOPPB+5NudysJji/lnxHQ9pFOMLMLeZ0O9hrnsuFsstbjczbC+14JHS+xsDf3pPgQXvUG6Q/H2fKV/B7jYX8RdOrug5BjG/1jueAPq1ElQb4AeH/sRNwnNyoFqsJwT9tWhChzL/IP/gxfleLSIgVQDdRvKBZVfu9wgKkeHEEfgIqa/F6fJ0HM8knJtkbCn4hKFvNDLWXDr8BGMywGD1Lh54AAAAASUVORK5CYII=")}body{font-family:"Libre Baskerville",Baskerville,Georgia,serif;background-color:#f8f8f8;color:#111;line-height:1.3;text-align:justify;-moz-hyphens:auto;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}@media (max-width: 400px){body{font-size:12px;margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:15px}}@media (min-width: 401px) and (max-width: 600px){body{font-size:14px;margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:15px}}@media (min-width: 601px) and (max-width: 900px){body{font-size:15px;margin-left:100px;margin-right:100px;margin-top:20px;margin-bottom:25px}}@media (min-width: 901px) and (max-width: 1800px){body{font-size:17px;margin-left:200px;margin-right:200px;margin-top:30px;margin-bottom:25px;max-width:800px}}@media (min-width: 1801px){body{font-size:18px;margin-left:20%;margin-right:20%;margin-top:30px;margin-bottom:25px;max-width:1000px}}p{margin-top:10px;margin-bottom:18px}em{font-style:italic}strong{font-weight:bold}h1,h2,h3,h4,h5,h6{font-weight:bold;padding-top:0.25em;margin-bottom:0.15em}header{line-height:2.475em;padding-bottom:0.7em;border-bottom:1px solid #bbb;margin-bottom:1.2em}header>h1{border:none;padding:0;margin:0;font-size:225%}header>h2{border:none;padding:0;margin:0;font-style:normal;font-size:175%}header>h3{padding:0;margin:0;font-size:125%;font-style:italic}header+h1{border-top:none;padding-top:0px}h1{border-top:1px solid #bbb;padding-top:15px;font-size:150%;margin-bottom:10px}h1:first-of-type{border:none}h2{font-size:125%;font-style:italic}h3{font-size:105%;font-style:italic}hr{border:0px;border-top:1px solid #bbb;width:100%;height:0px}hr+h1{border-top:none;padding-top:0px}ul,ol{font-size:90%;margin-top:10px;margin-bottom:15px;padding-left:30px}ul{list-style:circle}ol{list-style:decimal}ul ul,ol ol,ul ol,ol ul{font-size:inherit}li{margin-top:5px;margin-bottom:7px}q,blockquote,dd{font-style:italic;font-size:90%}blockquote,dd{quotes:none;border-left:0.35em #bbb solid;padding-left:1.15em;margin:0 1.5em 0 0}blockquote blockquote,dd blockquote,blockquote dd,dd dd,ol blockquote,ol dd,ul blockquote,ul dd,blockquote ol,dd ol,blockquote ul,dd ul{font-size:inherit}a,a:link,a:visited,a:hover{color:inherit;text-decoration:none;border-bottom:1px dashed #111}a:hover,a:link:hover,a:visited:hover,a:hover:hover{border-bottom-style:solid}a.footnoteRef,a:link.footnoteRef,a:visited.footnoteRef,a:hover.footnoteRef{border-bottom:none;color:#666}code{font-family:"Source Code Pro","Consolas","Monaco",monospace;font-size:85%;background-color:#ddd;border:1px solid #bbb;padding:0px 0.15em 0px 0.15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}pre{margin-right:1.5em;display:block}pre>code{display:block;font-size:70%;padding:10px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;overflow-x:auto}blockquote pre,dd pre,ul pre,ol pre{margin-left:0;margin-right:0}blockquote pre>code,dd pre>code,ul pre>code,ol pre>code{font-size:77.77778%}caption,figcaption{font-size:80%;font-style:italic;text-align:right;margin-bottom:5px}caption:empty,figcaption:empty{display:none}table{width:100%;margin-top:1em;margin-bottom:1em}table+h1{border-top:none}tr td,tr th{padding:0.2em 0.7em}tr.header{border-top:1px solid #222;border-bottom:1px solid #222;font-weight:700}tr.odd{background-color:#eee}tr.even{background-color:#ccc}tbody:last-child{border-bottom:1px solid #222}dt{font-weight:700}dt:after{font-weight:normal;content:":"}dd{margin-bottom:10px}figure{margin:1.3em 0 1.3em 0;text-align:center;padding:0px;width:100%;background-color:#ddd;border:1px solid #bbb;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;overflow:hidden}img{display:block;margin:0px auto;padding:0px;max-width:100%}figcaption{margin:5px 10px 5px 30px}.footnotes{color:#666;font-size:70%;font-style:italic}.footnotes li p:last-child a:last-child{border-bottom:none} diff --git a/output/commandes/tp.html b/output/commandes/tp.html new file mode 100644 index 0000000..de25569 --- /dev/null +++ b/output/commandes/tp.html @@ -0,0 +1,172 @@ + + + + + + + + + +
+

+ +
+ +
+

Travaux pratiques (autres commandes UNIX)

+

Cette seconde série de travaux pratiques se décompose en 4 parties :

+
    +
  1. commandes utilisateurs,
  2. +
  3. gestion des droits,
  4. +
  5. archivage et décompression,
  6. +
  7. gestion des processus.
  8. +
+

Commandes utilisateurs

+

Identifiez-vous : quels sont votre user id (uid) et votre groupe (gid) ?

+

Voir la solution

+
$ whoami
+        [votre username]
+        $ id
+        uid=[votre username] gid=users
+

+

Gestion des droits

+ +

Voir la solution

+

Dépend de votre configuration, mais s'observe en faisant un ll pour afficher les droits pris par le fichier testUmask.txt lors de la copie sous votre compte.
+ En prenant pour exemple les droits présentés plus haut : rwxrwxr-x

+

txt user (u) : rwx, binaire 111 octal 7 group (g) : rwx, binaire 111 octal 7 other (o) : r-x, binaire 101 octal 5

+

Donc profil octal 775, d'où un umask de 002 (sa négation en octal).
+ On peut aussi lancer umask comme commande en ligne...

+ +

La première façon de procéder utilisera un profil octal, la seconde des lettres. Contrôlez vos actions à chaque étape.

+

Voir la solution

+ +

+ +

Voir la solution

+

bash find ~ -name .profile

+

+ +

Voir la solution

+

bash $ diff testDiff1.txt testDiff2.txt 3a4 > LIGNE AJOUTEE 6d6 < LIGNE A SUPPRIMER 9c9 < Modifiez-moi !!! --- > Modifiée

+

+

Archivage et compression

+ +

Voir la solution

+

Le plus simple est d'abord de vous déplacer dans le répertoire parent de UnixShell pour l'archiver :

+

bash $ cd .. $ pwd / ... /Formation $ ll drwxrwxr-x 4 [uid] [gid] 1024 Apr 5 13:15 ./ drwxrwxr-x 16 [uid] [gid] 512 Apr 25 16:35 ../ drwxrwxr-x 4 [uid] [gid] 1024 Apr 25 10:03 UnixShell

+

bash $ tar -cvf Archives.tar UnixShell $ ll drwxrwxr-x 4 [uid] [gid] 1024 Apr 5 13:15 ./ drwxrwxr-x 16 [uid] [gid] 512 Apr 25 16:35 ../ drwxrwxr-x 4 [uid] [gid] 1024 Apr 25 10:03 UnixShell -rwxrwxr-x 1 [uid] [gid] 10240 May 5 14:23 Archives.tar

+

+ +

Voir la solution

+

bash $ cd UnixShell $ pwd / ... /Formation/UnixShell

+

bash $ mkdir tarzip $ mv ../Archives.tar tarzip

+

bash $ tar -xvf tarzip/Archives.tar UnixShell/ UnixShell/monHistorique.txt UnixShell/testDiff1.txt UnixShell/testDiff2.txt

+

bash $ ll drwxrwxr-x 4 [uid] [gid] 512 May 5 15:25 ./ drwxrwxr-x 4 [uid] [gid] 1024 Apr 25 10:03 ../ drwxrwxr-x 4 [uid] [gid] 1024 May 5 14:23 UnixShell/ -rwxrwxr-x 1 [uid] [gid] 212 May 5 10:10 monHistorique.txt drwxrwxr-x 2 [uid] [gid] 512 May 5 15:18 tarzip/ -rwxrwxr-x 1 [uid] [gid] 261 May 5 14:12 testDiff1.txt -rwxrwxr-x 1 [uid] [gid] 249 May 5 14:13 testDiff2.txt

+

Si vous avez travaillé comme cela, vous devez constater que le répertoire UnixShell s'est désarchivé sous lui-même...
+ C'est bien sûr un exemple se voulant surtout didactique.
+ Dans une situation plus concrète, le désarchivage doit s'opérer aux endroits les plus adéquats !

+ +

Voir la solution

+

bash $ gzip tarzip/Archives.tar $ ll tarzip -rwxrwxr-x 1 [uid] [gid] 612 May 5 16:23 Archives.tar.gz

+

bash $ gzip -l tarzip/Archives.tar.gz compressed uncompr. ratio uncompressed_name 612 10240 94.3% tarzip/Archives.tar

+

+ +

Voir la solution

+

bash $ gunzip tarzip/Archives.tar $ ll tarzip -rwxrwxr-x 1 [uid] [gid] 10240 May 5 14:23 Archives.tar

+

bash $ gzip tarzip/Archives.tar -rwxrwxr-x 1 [uid] [gid] 612 May 5 16:48 Archives.tar.gz

+

+ +

Voir la solution

+

bash $ gunzip -c tarzip/Archives.tar | wc -l

+

+

Précédent - Suivant

+
+ + + + + \ No newline at end of file diff --git a/output/images/Make.gif b/output/images/Make.gif new file mode 100644 index 0000000..3f48c45 --- /dev/null +++ b/output/images/Make.gif Binary files differ diff --git a/output/images/Shell.gif b/output/images/Shell.gif new file mode 100644 index 0000000..a5669f0 --- /dev/null +++ b/output/images/Shell.gif Binary files differ diff --git a/output/images/style.css b/output/images/style.css new file mode 100644 index 0000000..b24537d --- /dev/null +++ b/output/images/style.css @@ -0,0 +1 @@ +@import url(//fonts.googleapis.com/css?family=Libre+Baskerville:400,400italic,700);@import url(//fonts.googleapis.com/css?family=Source+Code+Pro:400,400italic,700,700italic);/* normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}body,code,tr.odd,tr.even,figure{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAABOFBMVEWDg4NycnJnZ2ebm5tjY2OgoKCurq5lZWWoqKiKiopmZmahoaGOjo5TU1N6enp7e3uRkZGJiYmFhYWxsbFOTk6Xl5eBgYGkpKRhYWFRUVGvr69dXV2wsLBiYmKnp6dUVFR5eXmdnZ1sbGxYWFh2dnZ0dHSmpqaZmZlVVVVqamqsrKyCgoJ3d3dubm5fX19tbW2ioqKSkpJWVlaHh4epqalSUlKTk5OVlZWysrJoaGhzc3N+fn5wcHBaWlqcnJxkZGRpaWlvb2+zs7NcXFxPT09/f3+lpaWWlpaQkJCjo6OIiIitra2enp6YmJhQUFBZWVmqqqqLi4uNjY1eXl6rq6ufn599fX2AgIB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RKdks7OV35txMGkdXzOkkhX9wTr+tIOGKZzjoo+qbWy3hsJJtz5D7nP+syyjxYe7eCAMIOywwFNfv/ZMNyBSxV0g7ZEJCPVE8IA5sw7jg9Kx3RXdfCQXGxpH+0kyHYpBj0H4y2VdAHRW9RyegOPPB+5NudysJji/lnxHQ9pFOMLMLeZ0O9hrnsuFsstbjczbC+14JHS+xsDf3pPgQXvUG6Q/H2fKV/B7jYX8RdOrug5BjG/1jueAPq1ElQb4AeH/sRNwnNyoFqsJwT9tWhChzL/IP/gxfleLSIgVQDdRvKBZVfu9wgKkeHEEfgIqa/F6fJ0HM8knJtkbCn4hKFvNDLWXDr8BGMywGD1Lh54AAAAASUVORK5CYII=")}body{font-family:"Libre Baskerville",Baskerville,Georgia,serif;background-color:#f8f8f8;color:#111;line-height:1.3;text-align:justify;-moz-hyphens:auto;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}@media (max-width: 400px){body{font-size:12px;margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:15px}}@media (min-width: 401px) and (max-width: 600px){body{font-size:14px;margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:15px}}@media (min-width: 601px) and (max-width: 900px){body{font-size:15px;margin-left:100px;margin-right:100px;margin-top:20px;margin-bottom:25px}}@media (min-width: 901px) and (max-width: 1800px){body{font-size:17px;margin-left:200px;margin-right:200px;margin-top:30px;margin-bottom:25px;max-width:800px}}@media (min-width: 1801px){body{font-size:18px;margin-left:20%;margin-right:20%;margin-top:30px;margin-bottom:25px;max-width:1000px}}p{margin-top:10px;margin-bottom:18px}em{font-style:italic}strong{font-weight:bold}h1,h2,h3,h4,h5,h6{font-weight:bold;padding-top:0.25em;margin-bottom:0.15em}header{line-height:2.475em;padding-bottom:0.7em;border-bottom:1px solid #bbb;margin-bottom:1.2em}header>h1{border:none;padding:0;margin:0;font-size:225%}header>h2{border:none;padding:0;margin:0;font-style:normal;font-size:175%}header>h3{padding:0;margin:0;font-size:125%;font-style:italic}header+h1{border-top:none;padding-top:0px}h1{border-top:1px solid #bbb;padding-top:15px;font-size:150%;margin-bottom:10px}h1:first-of-type{border:none}h2{font-size:125%;font-style:italic}h3{font-size:105%;font-style:italic}hr{border:0px;border-top:1px solid #bbb;width:100%;height:0px}hr+h1{border-top:none;padding-top:0px}ul,ol{font-size:90%;margin-top:10px;margin-bottom:15px;padding-left:30px}ul{list-style:circle}ol{list-style:decimal}ul ul,ol ol,ul ol,ol ul{font-size:inherit}li{margin-top:5px;margin-bottom:7px}q,blockquote,dd{font-style:italic;font-size:90%}blockquote,dd{quotes:none;border-left:0.35em #bbb solid;padding-left:1.15em;margin:0 1.5em 0 0}blockquote blockquote,dd blockquote,blockquote dd,dd dd,ol blockquote,ol dd,ul blockquote,ul dd,blockquote ol,dd ol,blockquote ul,dd ul{font-size:inherit}a,a:link,a:visited,a:hover{color:inherit;text-decoration:none;border-bottom:1px dashed #111}a:hover,a:link:hover,a:visited:hover,a:hover:hover{border-bottom-style:solid}a.footnoteRef,a:link.footnoteRef,a:visited.footnoteRef,a:hover.footnoteRef{border-bottom:none;color:#666}code{font-family:"Source Code Pro","Consolas","Monaco",monospace;font-size:85%;background-color:#ddd;border:1px solid #bbb;padding:0px 0.15em 0px 0.15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}pre{margin-right:1.5em;display:block}pre>code{display:block;font-size:70%;padding:10px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;overflow-x:auto}blockquote pre,dd pre,ul pre,ol pre{margin-left:0;margin-right:0}blockquote pre>code,dd pre>code,ul pre>code,ol pre>code{font-size:77.77778%}caption,figcaption{font-size:80%;font-style:italic;text-align:right;margin-bottom:5px}caption:empty,figcaption:empty{display:none}table{width:100%;margin-top:1em;margin-bottom:1em}table+h1{border-top:none}tr td,tr th{padding:0.2em 0.7em}tr.header{border-top:1px solid #222;border-bottom:1px solid #222;font-weight:700}tr.odd{background-color:#eee}tr.even{background-color:#ccc}tbody:last-child{border-bottom:1px solid #222}dt{font-weight:700}dt:after{font-weight:normal;content:":"}dd{margin-bottom:10px}figure{margin:1.3em 0 1.3em 0;text-align:center;padding:0px;width:100%;background-color:#ddd;border:1px solid #bbb;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;overflow:hidden}img{display:block;margin:0px auto;padding:0px;max-width:100%}figcaption{margin:5px 10px 5px 30px}.footnotes{color:#666;font-size:70%;font-style:italic}.footnotes li p:last-child a:last-child{border-bottom:none} diff --git a/output/make/README.html b/output/make/README.html new file mode 100644 index 0000000..f70913d --- /dev/null +++ b/output/make/README.html @@ -0,0 +1,68 @@ + + + + + Make - UNIX + + + + +
+

Make - UNIX

+ +
+ +
+

Make - UNIX

+

GNU Make est un héritier de make, mais sous Linux, c'est bien GNU Make qui est installé.

+

Make permet de gagner du temps par rapport aux shells: on n'exécute que ce qui est nécessaire, en fonction des changements de source par rapport à leur cible.

+

Un shell fait tous les traitements qui y sont indiqués.

+
+ Un shell fait tous les traitements qui y sont indiqués
Un shell fait tous les traitements qui y sont indiqués
+
+

Un make ne fait que les traitements qui sont nécessaires.

+
+ Un make ne fait que les traitements qui sont nécessaires
Un make ne fait que les traitements qui sont nécessaires
+
+

Syntaxe

+

Le fichier Makefile contient les règles de dépendance.

+

Une règle est de la forme :

+
cible: [fichier de départ] ...
+            commande
+
+

⚠ La commande doit être précédée d'une tabulation!

+
+

Pour créer le fichier cible : make cible

+

Exemple de fichier Makefile :

+
# Commentaire
+        compte.txt: aCompter.txt
+            wc -l < aCompter.txt > compte.txt
+

La deuxième fois qu'on lance la cible compte.txt, la commande wc n'est pas exécutée, sauf si le fichier aCompter.txt a une date de modification plus récente que celle de compte.txt.

+

Une règle qui ne dépend d'aucun fichier de départ peut exister.
+ De plus, elle ne peut donner lieu à la création d'un fichier.
+ Une telle règle sera toujours exécutée (à condition que son nom ne soit pas celui d'un fichier).

+

Références

+ +

Précédent - Suivant

+
+ + + + + \ No newline at end of file diff --git a/output/make/style.css b/output/make/style.css new file mode 100644 index 0000000..b24537d --- /dev/null +++ b/output/make/style.css @@ -0,0 +1 @@ +@import url(//fonts.googleapis.com/css?family=Libre+Baskerville:400,400italic,700);@import url(//fonts.googleapis.com/css?family=Source+Code+Pro:400,400italic,700,700italic);/* normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,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CeNLL0hgjGUOHdvb25YDijfq/An/D+iv7BBDutUsyuvBrH2ya6j2SIkLvjxFIpk8H37wcAt9KHX9cLeNmn+8CR1xtKgrzojVXl/qikMqAsDcO1coQrEanpsrB3DlAImIwS07oN2k3C2x2jSE3jxSm908P1tUXUMD15Lpp50CHii7i2BDSdYMcfB7+X7QdqymsDWH6BJ5APN+qIRhTVc/msYf5CjOyA82VSuIEtZA3GmUuXBK2r6xJ2LXO8fCU9kmCvydDptoECLq+XXLs4w8U+DUZyir9Cw+XL3rHFGoDNI9Rw3baFy/fZwTY2Gr0WMuLaxMrWaC5rh+IeyZijp0fdaDLPg8YtugLgnwYZss1xIh1o13qB7L8pC6wEutNQVuy5aIpNkSSl2yWAiRADUVXSMqpTH8Da3gCNr8maodNIxjY7CXyvzHHfiJoto/CE9UMmX+cRqPC8RKdks7OV35txMGkdXzOkkhX9wTr+tIOGKZzjoo+qbWy3hsJJtz5D7nP+syyjxYe7eCAMIOywwFNfv/ZMNyBSxV0g7ZEJCPVE8IA5sw7jg9Kx3RXdfCQXGxpH+0kyHYpBj0H4y2VdAHRW9RyegOPPB+5NudysJji/lnxHQ9pFOMLMLeZ0O9hrnsuFsstbjczbC+14JHS+xsDf3pPgQXvUG6Q/H2fKV/B7jYX8RdOrug5BjG/1jueAPq1ElQb4AeH/sRNwnNyoFqsJwT9tWhChzL/IP/gxfleLSIgVQDdRvKBZVfu9wgKkeHEEfgIqa/F6fJ0HM8knJtkbCn4hKFvNDLWXDr8BGMywGD1Lh54AAAAASUVORK5CYII=")}body{font-family:"Libre Baskerville",Baskerville,Georgia,serif;background-color:#f8f8f8;color:#111;line-height:1.3;text-align:justify;-moz-hyphens:auto;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}@media (max-width: 400px){body{font-size:12px;margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:15px}}@media (min-width: 401px) and (max-width: 600px){body{font-size:14px;margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:15px}}@media (min-width: 601px) and (max-width: 900px){body{font-size:15px;margin-left:100px;margin-right:100px;margin-top:20px;margin-bottom:25px}}@media (min-width: 901px) and (max-width: 1800px){body{font-size:17px;margin-left:200px;margin-right:200px;margin-top:30px;margin-bottom:25px;max-width:800px}}@media (min-width: 1801px){body{font-size:18px;margin-left:20%;margin-right:20%;margin-top:30px;margin-bottom:25px;max-width:1000px}}p{margin-top:10px;margin-bottom:18px}em{font-style:italic}strong{font-weight:bold}h1,h2,h3,h4,h5,h6{font-weight:bold;padding-top:0.25em;margin-bottom:0.15em}header{line-height:2.475em;padding-bottom:0.7em;border-bottom:1px solid #bbb;margin-bottom:1.2em}header>h1{border:none;padding:0;margin:0;font-size:225%}header>h2{border:none;padding:0;margin:0;font-style:normal;font-size:175%}header>h3{padding:0;margin:0;font-size:125%;font-style:italic}header+h1{border-top:none;padding-top:0px}h1{border-top:1px solid #bbb;padding-top:15px;font-size:150%;margin-bottom:10px}h1:first-of-type{border:none}h2{font-size:125%;font-style:italic}h3{font-size:105%;font-style:italic}hr{border:0px;border-top:1px solid #bbb;width:100%;height:0px}hr+h1{border-top:none;padding-top:0px}ul,ol{font-size:90%;margin-top:10px;margin-bottom:15px;padding-left:30px}ul{list-style:circle}ol{list-style:decimal}ul ul,ol ol,ul ol,ol ul{font-size:inherit}li{margin-top:5px;margin-bottom:7px}q,blockquote,dd{font-style:italic;font-size:90%}blockquote,dd{quotes:none;border-left:0.35em #bbb solid;padding-left:1.15em;margin:0 1.5em 0 0}blockquote blockquote,dd blockquote,blockquote dd,dd dd,ol blockquote,ol dd,ul blockquote,ul dd,blockquote ol,dd ol,blockquote ul,dd ul{font-size:inherit}a,a:link,a:visited,a:hover{color:inherit;text-decoration:none;border-bottom:1px dashed #111}a:hover,a:link:hover,a:visited:hover,a:hover:hover{border-bottom-style:solid}a.footnoteRef,a:link.footnoteRef,a:visited.footnoteRef,a:hover.footnoteRef{border-bottom:none;color:#666}code{font-family:"Source Code Pro","Consolas","Monaco",monospace;font-size:85%;background-color:#ddd;border:1px solid #bbb;padding:0px 0.15em 0px 0.15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}pre{margin-right:1.5em;display:block}pre>code{display:block;font-size:70%;padding:10px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;overflow-x:auto}blockquote pre,dd pre,ul pre,ol pre{margin-left:0;margin-right:0}blockquote pre>code,dd pre>code,ul pre>code,ol pre>code{font-size:77.77778%}caption,figcaption{font-size:80%;font-style:italic;text-align:right;margin-bottom:5px}caption:empty,figcaption:empty{display:none}table{width:100%;margin-top:1em;margin-bottom:1em}table+h1{border-top:none}tr td,tr th{padding:0.2em 0.7em}tr.header{border-top:1px solid #222;border-bottom:1px solid #222;font-weight:700}tr.odd{background-color:#eee}tr.even{background-color:#ccc}tbody:last-child{border-bottom:1px solid #222}dt{font-weight:700}dt:after{font-weight:normal;content:":"}dd{margin-bottom:10px}figure{margin:1.3em 0 1.3em 0;text-align:center;padding:0px;width:100%;background-color:#ddd;border:1px solid #bbb;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;overflow:hidden}img{display:block;margin:0px auto;padding:0px;max-width:100%}figcaption{margin:5px 10px 5px 30px}.footnotes{color:#666;font-size:70%;font-style:italic}.footnotes li p:last-child a:last-child{border-bottom:none} diff --git a/output/make/tp.html b/output/make/tp.html new file mode 100644 index 0000000..d62b341 --- /dev/null +++ b/output/make/tp.html @@ -0,0 +1,101 @@ + + + + + + + + + +
+

+ +
+ +
+

Travaux pratiques - Make - UNIX

+

Créer un fichier Makefile contenant une règle bonjour, qui affiche sur la sortie standard Bonjour, comment ca va?

+

Voir la solution

+
bonjour:
+            @echo "Bonjour, comment ca va?"
+
+

L'utilisation du @ devant echo rend la commande "silencieuse", elle n'apparaît pas sur la sortie standard.

+
+

+
+

Ajouter une règle bye qui affiche A bientot!.

+

Voir la solution

+
bye:
+            @echo "A bientot!"
+

+
+

Créer une règle qui crée un fichier modif.txt dont le contenu vient du fichier original.txt (que vous pouvez enregistrer grâce au bouton de droite) et qui remplace (grâce à sed) les apparitions de ILIB par DILIB.

+

Voir la solution

+
modif.txt: original.txt
+            sed -e 's/ILIB/DILIB/g' < original.txt > modif.txt
+

Le fichier modif.txt depend du contenu du fichier original.txt, c'est pourquoi ce dernier apparaît à droite de :.

+

+
+

Créer une règle qui crée un fichier modif2.txt à partir de original.txt et table.txt, en utilisant la table fournie pour modifier le fichier original.

+

Voir la solution

+
modif2.txt: original.txt table.txt
+            sed -f table.txt < original.txt > modif2.txt
+

Le fichier modif2.txt dépend des contenus des fichiers original.txt et table.txt (si l'un des deux est modifié, la commande sed sera exécutée).

+

+
+

Ajouter une ligne à table.txt pour remplacer CNRS par Centre National de la Recherche Scientifique.
+ Puis relancer make modif2.txt pour vérifier que la commande a bien été exécutée.

+
+

Ajouter une règle qui crée un fichier compte.txt contenant le nombre de lignes du fichier modif2.txt.

+

Voir la solution

+
compte.txt: modif2.txt
+            wc -l < modif2.txt > compte.txt
+

Le fichier compte.txt dépend du fichier modif2.txt (donc de sa règle, qui dépend de original.txt et de table.txt).
+ Donc si on modifie table.txt et qu'on tape make compte.txt, ou toute autre règle qui dépend directement ou indirectement de table.txt, cette règle sera exécutée.

+

+
+

Créer une règle clean qui supprime les fichiers dont le nom se termine par ~.

+

Voir la solution

+
clean:
+            rm -f *~
+
+

Si vous utilisez un lecteur Samba (probable à l'INIST), vous risquez une désynchronisation entre les fichiers enregistrés par le lecteur Samba et la date de lancement de make (il est arrivé que les fichiers aient une à deux minutes d'avance).
+ Pour limiter de tels problèmes, on peut utiliser la commande touch, qui remet un fichier à l'heure courante du shell, mais seulement sur les fichiers qui viennent d'être modifiés/créés!

+
+

+
+

Créer une règle all qui dépende de bonjour, compte.txt, clean, et bye, mais qui ne contient aucune commande (on peut quand même y mettre un echo -- Make all: exécuté --).

+

Remarques :

+ +

Voir la solution

+
all: bonjour compte.txt clean bye
+            @echo --- Make all: exécuté ---
+
+

On peut généraliser le @echo --- Make <règle> exécuté --- à toutes les règles, cela permet de mieux se rendre compte de ce que le make a effectué.

+
+

+
+

Pour ceux qui ne l'ont pas fait : modifier le fichier original.txt, et relancer la règle all.

+

Précédent

+
+ + + + + \ No newline at end of file diff --git a/output/sed/README.html b/output/sed/README.html new file mode 100644 index 0000000..38669fd --- /dev/null +++ b/output/sed/README.html @@ -0,0 +1,144 @@ + + + + + + + + + +
+

+ +
+ +
+

sed - UNIX

+

Sed (pour Stream EDitor) est un éditeur non interactif de texte.
+ Il permet d'appliquer une certain nombre de commandes à un fichier puis d'en afficher le résultat (sans modifier le fichier de départ) sur la sortie standard.
+ Comme avec toute commande unix, il est possible de rediriger la sortie vers un fichier résultat.

+

Substitution

+

La commande suivante lit un fichier file.txt et affiche ses lignes sur la sortie standard en remplaçant la chaîne « Dilib » par la chaîne « DILIB ».

+
sed 's/Dilib/DILIB/' file.txt
+

Il est conseillé d'entourer les commandes par des apostrophes simples, pour éviter que le shell n'interprète les caractères spéciaux (.*[]^$\).

+
+

⚠ Cette commande ne remplace que la première occurrence de « Dilib » sur chaque ligne du fichier.
+ S'il y en a deux, la deuxième ne sera pas remplacée, à moins d'utiliser l'option g en fin de commande :

+
sed 's/Dilib/DILIB/g' file.txt
+
+

Si on veut faire deux remplacements sur la même ligne de commandes, on peut utiliser :

+
sed -e 's/Dilib/DILIB/g' -e 's/Jacques Ducloy/Monsieur Dilib/g' file.txt
+
+

⚠ Le -e est obligatoire pour distinguer la deuxième commande d'un nom de fichier qui n'en est jamais précédé.

+

📗 Les commandes sont effectuées sur chaque ligne dans leur ordre d'apparition, ce qui veut dire que « Jacques Ducloy » sera transformé en « Monsieur Dilib » après la substitution de « Dilib » par « DILIB », il restera donc des « Dilib » sur la sortie standard.

+
+

Rappel sur les expressions régulières

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
^début de ligne
$fin de ligne
[]classe de caractères (exemples : [A-Z] correspond à toutes les lettres majuscules)
[^...]classe de caractères correspondant à n'importe quels caractères sauf ceux qui suivent le caractère ^
Exemple : [^:] correspond à tous les caractères sauf le :.
*le caractère précédant * répété de 0 à n fois
+le caractère précédant + répété de 1 à n fois
?le caractère précédant ? présent de 0 à 1 fois
+

Expressions régulières

+

On peut utiliser des expressions régulières dans les chaînes à remplacer (donc, il faut banaliser les caractères spéciaux dans cette chaîne).

+
sed -e 's/Jacques D[uU][cC][lL][oO][yY]/Monsieur Dilib/g' fichier
+
+

📗 Le caractère * englobe autant de caractères qu'il peut, ce qui veut dire que

+
sed 's/ré.*duction/réduction/g' fichier
+

transformera le fichier

+
do ré mi fa sol la si duction ah bon duction la suite
+

en

+
do réduction la suite
+

et non en

+
do réduction ah bon duction la suite
+
+

Récupération

+

Les opérateurs \( et \) sauvent leur contenu et permettent leur récupération par l'utilisation de \1, \2, etc.

+
sed -e 's/^\([A-Z][A-Za-z]*\), \([A-Z][A-Za-z]*\)/\2 \1/' fichier
+

Remplacera les « Nom, Prénom » en début de chaque ligne du fichier (quand il en trouve) par « Prénom Nom ».

+

Fichier de commandes

+

Si vous avez beaucoup de commandes, vous pouvez les rassembler dans un fichier comme celui-là :

+
# Fichier "exemple.sed"
+        # Il ne peut y avoir de commentaires que dans un bloc au début du
+        # fichier.
+        s/É/&Eacute;/g
+        s/À/&Agrave;/g
+        s/Ç/&Ccedil;/g
+

Pour appeler ce fichier, il faut utiliser l'option -f :

+
sed -f exemple.sed fichier
+

Une autre solution consiste à en faire un script exécutable (à la manière d'un script shell) :

+
#!/usr/bin/sed -f
+        # Table de transcodage de ISO-8859-1 vers HTML
+        # Fichier "exemple2.sed"
+        s/É/&Eacute;/g
+        s/À/&Agrave;/g
+        s/Ç/&Ccedil;/g
+

Mais il ne faut pas oublier de lui donner les droits en exécution, pour pouvoir l'appeler ainsi :

+
chmod u+x exemple2.sed
+        ./exemple2.sed fichier
+
+

⚠ Un fichier de commandes sed doit toujours se terminer par un passage à la ligne, sinon la dernière commande n'est pas prise en compte!

+
+
+

⚠ De la même manière, toutes les lignes à traiter doivent finir par un retour à la ligne (en particulier la dernière)!

+
+

Référence

+ +

Précédent - Suivant

+
+ + + + + \ No newline at end of file diff --git a/output/sed/style.css b/output/sed/style.css new file mode 100644 index 0000000..b24537d --- /dev/null +++ b/output/sed/style.css @@ -0,0 +1 @@ +@import url(//fonts.googleapis.com/css?family=Libre+Baskerville:400,400italic,700);@import url(//fonts.googleapis.com/css?family=Source+Code+Pro:400,400italic,700,700italic);/* normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}body,code,tr.odd,tr.even,figure{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAABOFBMVEWDg4NycnJnZ2ebm5tjY2OgoKCurq5lZWWoqKiKiopmZmahoaGOjo5TU1N6enp7e3uRkZGJiYmFhYWxsbFOTk6Xl5eBgYGkpKRhYWFRUVGvr69dXV2wsLBiYmKnp6dUVFR5eXmdnZ1sbGxYWFh2dnZ0dHSmpqaZmZlVVVVqamqsrKyCgoJ3d3dubm5fX19tbW2ioqKSkpJWVlaHh4epqalSUlKTk5OVlZWysrJoaGhzc3N+fn5wcHBaWlqcnJxkZGRpaWlvb2+zs7NcXFxPT09/f3+lpaWWlpaQkJCjo6OIiIitra2enp6YmJhQUFBZWVmqqqqLi4uNjY1eXl6rq6ufn599fX2AgIB8fHyEhIRxcXFra2tbW1uPj4+MjIyGhoaamppgYGB4eHhNTU1XV1d1dXW0tLSUlJSHWuNDAAAAaHRSTlMNDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDUnKohIAAAaZSURBVHhelZWFrmZVDEb3cffzq7u7u7u7u9z7/m8AhISQwMDMAzRN2/WtAhO7zOd0x0U/UNb0oWQZGLWhIHBK/lC96klgkA+3B5JoqI9ozRcn4306YeDweKG9vxo5YbGbqBkln93ZFGs3SA0RRpSO4dpdpg+VnMUv8BEqmiIcli8gJeRZc29K51qOg0OWHRGyA0ccrmbmSRj1r7x5JisCpAs+iuCd8GFc0pMGldB2BOC0VoY37qKJh5nqZNjb4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eKeQzSgeZZcaQb8+JYzehtPraBkg3Jc3e8boxVXJzNW23deFoZ74Vzy6xd1+FemwZ/neOnHQh2ufopy5c/r69Cz+scIrx+uN+dzhyzEjCeNLL0hgjGUOHdvb25YDijfq/An/D+iv7BBDutUsyuvBrH2ya6j2SIkLvjxFIpk8H37wcAt9KHX9cLeNmn+8CR1xtKgrzojVXl/qikMqAsDcO1coQrEanpsrB3DlAImIwS07oN2k3C2x2jSE3jxSm908P1tUXUMD15Lpp50CHii7i2BDSdYMcfB7+X7QdqymsDWH6BJ5APN+qIRhTVc/msYf5CjOyA82VSuIEtZA3GmUuXBK2r6xJ2LXO8fCU9kmCvydDptoECLq+XXLs4w8U+DUZyir9Cw+XL3rHFGoDNI9Rw3baFy/fZwTY2Gr0WMuLaxMrWaC5rh+IeyZijp0fdaDLPg8YtugLgnwYZss1xIh1o13qB7L8pC6wEutNQVuy5aIpNkSSl2yWAiRADUVXSMqpTH8Da3gCNr8maodNIxjY7CXyvzHHfiJoto/CE9UMmX+cRqPC8RKdks7OV35txMGkdXzOkkhX9wTr+tIOGKZzjoo+qbWy3hsJJtz5D7nP+syyjxYe7eCAMIOywwFNfv/ZMNyBSxV0g7ZEJCPVE8IA5sw7jg9Kx3RXdfCQXGxpH+0kyHYpBj0H4y2VdAHRW9RyegOPPB+5NudysJji/lnxHQ9pFOMLMLeZ0O9hrnsuFsstbjczbC+14JHS+xsDf3pPgQXvUG6Q/H2fKV/B7jYX8RdOrug5BjG/1jueAPq1ElQb4AeH/sRNwnNyoFqsJwT9tWhChzL/IP/gxfleLSIgVQDdRvKBZVfu9wgKkeHEEfgIqa/F6fJ0HM8knJtkbCn4hKFvNDLWXDr8BGMywGD1Lh54AAAAASUVORK5CYII=")}body{font-family:"Libre Baskerville",Baskerville,Georgia,serif;background-color:#f8f8f8;color:#111;line-height:1.3;text-align:justify;-moz-hyphens:auto;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}@media (max-width: 400px){body{font-size:12px;margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:15px}}@media (min-width: 401px) and (max-width: 600px){body{font-size:14px;margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:15px}}@media (min-width: 601px) and (max-width: 900px){body{font-size:15px;margin-left:100px;margin-right:100px;margin-top:20px;margin-bottom:25px}}@media (min-width: 901px) and (max-width: 1800px){body{font-size:17px;margin-left:200px;margin-right:200px;margin-top:30px;margin-bottom:25px;max-width:800px}}@media (min-width: 1801px){body{font-size:18px;margin-left:20%;margin-right:20%;margin-top:30px;margin-bottom:25px;max-width:1000px}}p{margin-top:10px;margin-bottom:18px}em{font-style:italic}strong{font-weight:bold}h1,h2,h3,h4,h5,h6{font-weight:bold;padding-top:0.25em;margin-bottom:0.15em}header{line-height:2.475em;padding-bottom:0.7em;border-bottom:1px solid #bbb;margin-bottom:1.2em}header>h1{border:none;padding:0;margin:0;font-size:225%}header>h2{border:none;padding:0;margin:0;font-style:normal;font-size:175%}header>h3{padding:0;margin:0;font-size:125%;font-style:italic}header+h1{border-top:none;padding-top:0px}h1{border-top:1px solid #bbb;padding-top:15px;font-size:150%;margin-bottom:10px}h1:first-of-type{border:none}h2{font-size:125%;font-style:italic}h3{font-size:105%;font-style:italic}hr{border:0px;border-top:1px solid #bbb;width:100%;height:0px}hr+h1{border-top:none;padding-top:0px}ul,ol{font-size:90%;margin-top:10px;margin-bottom:15px;padding-left:30px}ul{list-style:circle}ol{list-style:decimal}ul ul,ol ol,ul ol,ol ul{font-size:inherit}li{margin-top:5px;margin-bottom:7px}q,blockquote,dd{font-style:italic;font-size:90%}blockquote,dd{quotes:none;border-left:0.35em #bbb solid;padding-left:1.15em;margin:0 1.5em 0 0}blockquote blockquote,dd blockquote,blockquote dd,dd dd,ol blockquote,ol dd,ul blockquote,ul dd,blockquote ol,dd ol,blockquote ul,dd ul{font-size:inherit}a,a:link,a:visited,a:hover{color:inherit;text-decoration:none;border-bottom:1px dashed #111}a:hover,a:link:hover,a:visited:hover,a:hover:hover{border-bottom-style:solid}a.footnoteRef,a:link.footnoteRef,a:visited.footnoteRef,a:hover.footnoteRef{border-bottom:none;color:#666}code{font-family:"Source Code Pro","Consolas","Monaco",monospace;font-size:85%;background-color:#ddd;border:1px solid #bbb;padding:0px 0.15em 0px 0.15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}pre{margin-right:1.5em;display:block}pre>code{display:block;font-size:70%;padding:10px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;overflow-x:auto}blockquote pre,dd pre,ul pre,ol pre{margin-left:0;margin-right:0}blockquote pre>code,dd pre>code,ul pre>code,ol pre>code{font-size:77.77778%}caption,figcaption{font-size:80%;font-style:italic;text-align:right;margin-bottom:5px}caption:empty,figcaption:empty{display:none}table{width:100%;margin-top:1em;margin-bottom:1em}table+h1{border-top:none}tr td,tr th{padding:0.2em 0.7em}tr.header{border-top:1px solid #222;border-bottom:1px solid #222;font-weight:700}tr.odd{background-color:#eee}tr.even{background-color:#ccc}tbody:last-child{border-bottom:1px solid #222}dt{font-weight:700}dt:after{font-weight:normal;content:":"}dd{margin-bottom:10px}figure{margin:1.3em 0 1.3em 0;text-align:center;padding:0px;width:100%;background-color:#ddd;border:1px solid #bbb;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;overflow:hidden}img{display:block;margin:0px auto;padding:0px;max-width:100%}figcaption{margin:5px 10px 5px 30px}.footnotes{color:#666;font-size:70%;font-style:italic}.footnotes li p:last-child a:last-child{border-bottom:none} diff --git a/output/sed/tp.html b/output/sed/tp.html new file mode 100644 index 0000000..60201e0 --- /dev/null +++ b/output/sed/tp.html @@ -0,0 +1,91 @@ + + + + + + + + + +
+

+ +
+ +
+

Travaux pratiques - Sed - UNIX

+

Utilisation simple

+

Écrivez une commande sed transformant la chaîne « moins » en « plus ».
+ Appliquez-la à « Vous aurez moins de budget ».

+

Voir la solution

+
sed -e 's/moins/plus/g'
+

+

Utilisation d'un fichier de commandes

+

Écrivez un commande sed transformant toutes les lettres minuscules en leur suivante lexicographique (cas particulier : z se transforme en !).
+ Rappel : vous pouvez utiliser un fichier pour rassembler plusieurs commandes sed.

+

Voir la solution

+
sed -f decalage.sed
+
# fichier "decalage.sed"
+        s/z/!/g
+        s/y/z/g
+        s/x/y/g
+        s/w/x/g
+        s/v/w/g
+        s/u/v/g
+        s/t/u/g
+        s/s/t/g
+        s/r/s/g
+        s/q/r/g
+        s/p/q/g
+        s/o/p/g
+        s/n/o/g
+        s/m/n/g
+        s/l/m/g
+        s/k/l/g
+        s/j/k/g
+        s/i/j/g
+        s/h/i/g
+        s/g/h/g
+        s/f/g/g
+        s/e/f/g
+        s/d/e/g
+        s/c/d/g
+        s/b/c/g
+        s/a/b/g
+
+

📗 Cette solution peut sembler étrange, car les substitutions ne se font pas dans l'ordre alphabétique mais dans l'ordre alphabétique inverse.
+ C'est nécessaire car sinon tous les a se transforment en b, puis tous les b (y compris ceux qui sont nouvellement transformés) en c, etc., pour finir par un texte intégralement composé de lettres a.

+
+

+

Substitution en début de ligne

+

Écrivez une commande sed qui affiche uniquement le début de chaque ligne du fichier /etc/passwd jusqu'au premier caractère :.

+

Voir la solution

+
sed -e 's/^\([^:]*\).*$/\1/' /etc/passwd
+
+

📗 On aurait pu aussi utiliser la commande cut.

+
+

+

Substitution dans toute la ligne

+

Écrivez une commande sed qui remplace les couples de guillemets anglais par un couple de guillemets français (Ceci est un "exemple" qui doit "fonctionner". doit donner Ceci est un <<exemple>> qui doit <<fonctionner>>.).

+

Voir la solution

+
sed -e 's/"\([^"]*\)"/<<\1>>/g'
+

+

Précédent - Suivant

+
+ + + + + \ No newline at end of file diff --git a/output/shell/README.html b/output/shell/README.html new file mode 100644 index 0000000..7f6cf29 --- /dev/null +++ b/output/shell/README.html @@ -0,0 +1,89 @@ + + + + + + + + + +
+

+ +
+ +
+

Variables d'environnement - Shell - UNIX

+

Le shell contient diverses variables d'environnement.
+ Si vous voulez les voir toutes, utilisez la commande set ou la commande env sans paramètre.

+

Certaines de ces variables peuvent nous intéresser plus particulièrement (pour visualiser leur contenu, utilisez la commande echo, par exemple echo $HOME pour afficher le contenu de la variable HOME) :

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
nomcontenu
HOMEchemin de votre home directory
PATHliste des chemins parcourus par le shell pour trouver les commandes à exécuter (quand le chemin complet n'est pas précisé)
PS1"Prompt" utilisé dans le shell (on peut modifier sa valeur)
SHELLindique le shell qu'on utilise
USERvotre nom d'utilisateur
+

Pour modifier la valeur d'une variable (ou en créer une), il suffit d'utiliser la syntaxe :

+
VARIABLE=valeur
+
+

⚠ Il ne faut pas mettre d'espace autour du caractère =

+
+

Par convention, les noms de variable sont en majuscules.
+ Pour accéder à la valeur d'une variable, on utilise :

+
$VARIABLE
+

ou, pour éviter des ambiguités (si a="var", ${a}b renvoie varb alors que $ab est invalide) :

+
${VARIABLE}
+

On peut créer des variables utilisateurs de la même manière.

+

Une variable n'est disponible que dans le shell où on l'a initialisée.

+

Faire précéder l'affectation d'une variable du mot-clé export autorise son utilisation dans un shell différent.

+
export VARIABLE=valeur
+
+

Pour plus d'information sur les variables (en bash), voir How To Use Bash Parameter Substitution Like A Pro

+
+

Précédent - Suivant

+
+ + + + + \ No newline at end of file diff --git a/output/shell/commandes.html b/output/shell/commandes.html new file mode 100644 index 0000000..6b90750 --- /dev/null +++ b/output/shell/commandes.html @@ -0,0 +1,107 @@ + + + + + + + + + +
+

+ +
+ +
+

Commandes diverses - Shell - UNIX

+

Commandes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#commentaires (mais #!/bin/sh en début de fichier est le shebang)
( commande )exécute la commande dans un sous-shell
read alecture d'une entrée pendant l'exécution d'un script
exit numrenvoie le statut du script au shell appelant
. scriptinclusion et exécution du script dans le shell courant
exec scriptexécute le script dans un nouveau shell
cmd1 \|\| cmd2séparateur conditionnel (cmd2 est exécutée même si cmd1 ne s'est pas exécutée correctement)
cmd1 && cmd2séparateur conditionnel (cmd2 est exécutée seulement si cmd1 s'est exécutée correctement)
setliste de toutes les variables.
Positionne les paramètres $i (set a b c positionne $1 à a, $2 à b et $3 à c).
unset varremise à zéro de la variable var
type cmdeindique la nature (et la localisaton) d'une commande
alias al='cmd'crée une commande al équivalente à la commande cmd (qui peut être complexe)
touch fichierchange la date de dernière modification du fichier. Si le fichier n'existe pas, crée un fichier vide.
+

expr

+

expr exécute des opérations arithmétiques sur des entiers (l'opérateur peut être +, -, \*, /, %, =, \>, \<, \>=, \<=, !=).

+

L'expression est une commande, donc pour affecter une opération à une variable, il faut forcer son exécution avec des antiquotes (AltGr-7) :

+
a=`expr $b + $c`
+
+

Si vous utilisez bash, il existe une syntaxe plus facile: $((..)) (voir How to Increment and Decrement Variable in Bash (Counter))

+
+

Précédent - Suivant

+
+ + + + + \ No newline at end of file diff --git a/output/shell/conditions.html b/output/shell/conditions.html new file mode 100644 index 0000000..cceef5d --- /dev/null +++ b/output/shell/conditions.html @@ -0,0 +1,144 @@ + + + + + + + + + +
+

+ +
+ +
+

Conditions - Shell - UNIX

+

Les commandes if, while, et until testent le statut de la commande qu'ils ont en paramètre.

+

if

+

Syntaxe

+
if commande
+        then
+             liste_commandes
+        [elif commande
+         then
+             liste_commandes] ...
+        [else liste_commandes]
+        fi
+

Exemples

+
if test -f $1
+        then
+             cat $1
+        else
+             echo "Le fichier \"$1\" n'existe pas"
+        fi
+

test

+

test est une commande qui renvoie une valeur vraie ou fausse (0 pour vrai, 1 pour fausse).
+ Elle a différentes options permettant de tester différentes conditions sur des fichiers, des valeurs (chaînes de caractères), etc.

+

Sa syntaxe est test expr ou [ expr ] (attention, il faut un espace après [ et avant ]).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
exprsignification
-r fichiervrai si le fichier existe et est accessible en lecture (r)
-w fichiervrai si le fichier existe et est accessible en écriture (w)
-x fichiervrai si le fichier existe et est exécutable (x)
-f fichiervrai si le fichier existe et est un fichier "régulier" (file)
-d fichiervrai si le fichier existe et est un répertoire (directory)
-s fichiervrai si le fichier existe et a une taille non nulle (size)
c1 = c2vrai si les deux expressions sont égales (des chaînes, en sh)
c1 != c2vrai si les deux expressions sont différentes (des chaînes, en sh)
c1vrai si c1 n'est pas la chaîne nulle (vide)
e1 -eq e2vrai si les deux entiers e1 et e2 sont algébriquement égaux (equal)
e1 -ne e2vrai si les deux entiers e1 et e2 sont algébriquement différents (not equal)
e1 -gt e2vrai si l'entier e1 est plus grand que l'entier e2 (greater than)
e1 -lt e2vrai si l'entier e1 est plus petit que e2 (lower than)
! exprnégation de l'expression booléenne expr
expr1 -a expr2et logique entre les deux expressions booléennes expr1 et expr2 (and)
expr1 -o expr2ou logique entre les deux expressions booléennes expr1 et expr2 (or)
+

Exemples

+

Quand script.sh est un fichier qui existe dans le répertoire courant.

+
$ test -f script.sh
+        $ echo $?
+        0
+

Quand inexistant.sh est un fichier qui n'est pas dans le répertoire courant.

+
$ test -f inexistant.sh
+        $ echo $?
+        1
+

Précédent - Suivant

+
+ + + + + \ No newline at end of file diff --git a/output/shell/controle.html b/output/shell/controle.html new file mode 100644 index 0000000..303c837 --- /dev/null +++ b/output/shell/controle.html @@ -0,0 +1,89 @@ + + + + + + + + + +
+

+ +
+ +
+

Structures de contrôle - Shell - UNIX

+

for

+

Syntaxe

+
for var [in liste]
+        do
+             liste_commandes
+        done
+

La variable var prend successivement les valeurs de la liste.
+ Si la liste est omise, var prend alors les valeurs passées en paramètres du script ($*).

+

Exemples

+
for i
+        do
+            echo $i
+        done
+
for i in `ls`
+        do
+            cp $i /dir/$i
+            echo "$i copié"
+        done
+

Il ne faut pas oublier les apostrophes inversées (ou quotes inverses) ` qui forcent l'exécution du ls.

+

while

+

Syntaxe

+
while commande
+        do
+           liste_commandes
+        done
+

Exemple

+
while read a
+        do
+          echo $a >> resultat.txt
+          echo Appuyez sur Ctrl-D pour arrêter.
+        done
+

until

+

Syntaxe

+
until commande
+        do
+           liste_commandes
+        done
+

Exemple

+
until ! read a
+        do
+          echo $a >> resultat.txt
+          echo Appuyez sur Ctrl-D pour arrêter.
+        done
+

case

+

Syntaxe

+
case para in
+            choix1[|choix2] ... ) liste_commandes ;;
+        esac
+

Exemple

+
case $1 in
+             bonjour ) echo "Bonjour aussi." ;;
+             A+ | a+ ) echo "À bientôt." ;;
+             * )       echo "Je n'ai pas bien compris le paramètre \"$1\".";;
+        esac
+

Précédent - Suivant

+
+ + + + + \ No newline at end of file diff --git a/output/shell/parametres.html b/output/shell/parametres.html new file mode 100644 index 0000000..df8124d --- /dev/null +++ b/output/shell/parametres.html @@ -0,0 +1,111 @@ + + + + + + + + + +
+

+ +
+ +
+

Paramètres - Shell - UNIX

+

Récupération des paramètres de la ligne de commande

+ + + + + + + + + + + + + + + + + + + +
$0nom de la commande
$nvaleur du nième paramètre
$#nombre de paramètres
$*liste de tous les paramètres
+

Pour la ligne de commande sh test.sh a b c, $0 vaut test.sh, $# vaut 3, $* vaut a b c, et $2 vaut b (à l'intérieur du script).

+

La commande shift décale les paramètres (en perdant le premier) : le deuxième paramètre devient le premier, le troisième devient le deuxième, etc. (c'est utile quand on utilise une boucle pour traiter les paramètres).

+

Variables spéciales

+ + + + + + + + + + + +
$$numéro de processus de la dernière commande
$?statut de la dernière commande (0 = tout s'est bien passé)
+

Caractères spéciaux

+

Comme à chaque fois qu'on a un caractère spécial (par exemple $), on a des caractères d'échappement.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\banalise le caractère suivantecho \$0 $0$0 /usr/bin/ksh
" ... "banalise les caractères sauf \, $ et `echo "\$0 $0"$0 /usr/bin/ksh
' ... 'banalise tous les caractèresecho '\$0 $0'\$0 $0
` ... `substitution de commandeecho `date`Mon May 5 16:54:14 MEST 2003
+
+

💡 En 2023, il est conseillé d'utiliser $(commande) pour la substitution de commande.
+ L'exemple devient ainsi echo $(date).

+
+

Précédent - Suivant

+
+ + + + + \ No newline at end of file diff --git a/output/shell/scripts.html b/output/shell/scripts.html new file mode 100644 index 0000000..ccc9126 --- /dev/null +++ b/output/shell/scripts.html @@ -0,0 +1,52 @@ + + + + + + + + + +
+

+ +
+ +
+

Scripts - Shell - UNIX

+

Un fichier script contenant des commandes shell (par exemple des initialisations de variables, une automatisation de tâches,...) peut être exécuté :

+ +

Pour être sûr du shell qui est en train de s'exécuter dans un fichier de script shell, il est plus prudent d'ajouter son nom en début de fichier la ligne (par exemple, ici sh) :

+
#!/bin/sh
+

Cette ligne a la forme d'un commentaire (elle commence par #), on l'appelle un shebang, et signale au shell appelant qu'il faut utiliser le shell /bin/sh pour exécuter le fichier.
+ Ce shebang, qui est un en-tête, doit se mettre sur la première ligne.

+

Une seconde ligne peut être intéressante car elle peut influer sur l'ordre de tri avec sort par exemple.
+ Pour garantir un ordre de tri lexicographique, on peut positionner la variable d'environnement suivante comme suit export LC_COLLATE=C.

+

Référence

+ +

Précédent - Suivant

+
+ + + + + \ No newline at end of file diff --git a/output/shell/style.css b/output/shell/style.css new file mode 100644 index 0000000..b24537d --- /dev/null +++ b/output/shell/style.css @@ -0,0 +1 @@ +@import url(//fonts.googleapis.com/css?family=Libre+Baskerville:400,400italic,700);@import url(//fonts.googleapis.com/css?family=Source+Code+Pro:400,400italic,700,700italic);/* normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}body,code,tr.odd,tr.even,figure{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAABOFBMVEWDg4NycnJnZ2ebm5tjY2OgoKCurq5lZWWoqKiKiopmZmahoaGOjo5TU1N6enp7e3uRkZGJiYmFhYWxsbFOTk6Xl5eBgYGkpKRhYWFRUVGvr69dXV2wsLBiYmKnp6dUVFR5eXmdnZ1sbGxYWFh2dnZ0dHSmpqaZmZlVVVVqamqsrKyCgoJ3d3dubm5fX19tbW2ioqKSkpJWVlaHh4epqalSUlKTk5OVlZWysrJoaGhzc3N+fn5wcHBaWlqcnJxkZGRpaWlvb2+zs7NcXFxPT09/f3+lpaWWlpaQkJCjo6OIiIitra2enp6YmJhQUFBZWVmqqqqLi4uNjY1eXl6rq6ufn599fX2AgIB8fHyEhIRxcXFra2tbW1uPj4+MjIyGhoaamppgYGB4eHhN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sJJtz5D7nP+syyjxYe7eCAMIOywwFNfv/ZMNyBSxV0g7ZEJCPVE8IA5sw7jg9Kx3RXdfCQXGxpH+0kyHYpBj0H4y2VdAHRW9RyegOPPB+5NudysJji/lnxHQ9pFOMLMLeZ0O9hrnsuFsstbjczbC+14JHS+xsDf3pPgQXvUG6Q/H2fKV/B7jYX8RdOrug5BjG/1jueAPq1ElQb4AeH/sRNwnNyoFqsJwT9tWhChzL/IP/gxfleLSIgVQDdRvKBZVfu9wgKkeHEEfgIqa/F6fJ0HM8knJtkbCn4hKFvNDLWXDr8BGMywGD1Lh54AAAAASUVORK5CYII=")}body{font-family:"Libre Baskerville",Baskerville,Georgia,serif;background-color:#f8f8f8;color:#111;line-height:1.3;text-align:justify;-moz-hyphens:auto;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}@media (max-width: 400px){body{font-size:12px;margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:15px}}@media (min-width: 401px) and (max-width: 600px){body{font-size:14px;margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:15px}}@media (min-width: 601px) and (max-width: 900px){body{font-size:15px;margin-left:100px;margin-right:100px;margin-top:20px;margin-bottom:25px}}@media (min-width: 901px) and (max-width: 1800px){body{font-size:17px;margin-left:200px;margin-right:200px;margin-top:30px;margin-bottom:25px;max-width:800px}}@media (min-width: 1801px){body{font-size:18px;margin-left:20%;margin-right:20%;margin-top:30px;margin-bottom:25px;max-width:1000px}}p{margin-top:10px;margin-bottom:18px}em{font-style:italic}strong{font-weight:bold}h1,h2,h3,h4,h5,h6{font-weight:bold;padding-top:0.25em;margin-bottom:0.15em}header{line-height:2.475em;padding-bottom:0.7em;border-bottom:1px solid #bbb;margin-bottom:1.2em}header>h1{border:none;padding:0;margin:0;font-size:225%}header>h2{border:none;padding:0;margin:0;font-style:normal;font-size:175%}header>h3{padding:0;margin:0;font-size:125%;font-style:italic}header+h1{border-top:none;padding-top:0px}h1{border-top:1px solid #bbb;padding-top:15px;font-size:150%;margin-bottom:10px}h1:first-of-type{border:none}h2{font-size:125%;font-style:italic}h3{font-size:105%;font-style:italic}hr{border:0px;border-top:1px solid #bbb;width:100%;height:0px}hr+h1{border-top:none;padding-top:0px}ul,ol{font-size:90%;margin-top:10px;margin-bottom:15px;padding-left:30px}ul{list-style:circle}ol{list-style:decimal}ul ul,ol ol,ul ol,ol ul{font-size:inherit}li{margin-top:5px;margin-bottom:7px}q,blockquote,dd{font-style:italic;font-size:90%}blockquote,dd{quotes:none;border-left:0.35em #bbb solid;padding-left:1.15em;margin:0 1.5em 0 0}blockquote blockquote,dd blockquote,blockquote dd,dd dd,ol blockquote,ol dd,ul blockquote,ul dd,blockquote ol,dd ol,blockquote ul,dd ul{font-size:inherit}a,a:link,a:visited,a:hover{color:inherit;text-decoration:none;border-bottom:1px dashed #111}a:hover,a:link:hover,a:visited:hover,a:hover:hover{border-bottom-style:solid}a.footnoteRef,a:link.footnoteRef,a:visited.footnoteRef,a:hover.footnoteRef{border-bottom:none;color:#666}code{font-family:"Source Code Pro","Consolas","Monaco",monospace;font-size:85%;background-color:#ddd;border:1px solid #bbb;padding:0px 0.15em 0px 0.15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}pre{margin-right:1.5em;display:block}pre>code{display:block;font-size:70%;padding:10px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;overflow-x:auto}blockquote pre,dd pre,ul pre,ol pre{margin-left:0;margin-right:0}blockquote pre>code,dd pre>code,ul pre>code,ol pre>code{font-size:77.77778%}caption,figcaption{font-size:80%;font-style:italic;text-align:right;margin-bottom:5px}caption:empty,figcaption:empty{display:none}table{width:100%;margin-top:1em;margin-bottom:1em}table+h1{border-top:none}tr td,tr th{padding:0.2em 0.7em}tr.header{border-top:1px solid #222;border-bottom:1px solid #222;font-weight:700}tr.odd{background-color:#eee}tr.even{background-color:#ccc}tbody:last-child{border-bottom:1px solid #222}dt{font-weight:700}dt:after{font-weight:normal;content:":"}dd{margin-bottom:10px}figure{margin:1.3em 0 1.3em 0;text-align:center;padding:0px;width:100%;background-color:#ddd;border:1px solid #bbb;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;overflow:hidden}img{display:block;margin:0px auto;padding:0px;max-width:100%}figcaption{margin:5px 10px 5px 30px}.footnotes{color:#666;font-size:70%;font-style:italic}.footnotes li p:last-child a:last-child{border-bottom:none} diff --git a/output/shell/tp.html b/output/shell/tp.html new file mode 100644 index 0000000..00cc671 --- /dev/null +++ b/output/shell/tp.html @@ -0,0 +1,156 @@ + + + + + + + + + +
+

+ +
+ +
+

Travaux pratiques - Shell - UNIX

+
+

⚠ Tous les shells qui seront créés par la suite devront avoir le droit d'exécution correctement positionné, au moins pour leur propriétaire.

+
+

Recherche d'information sur un utilisateur

+
    +
  1. Écrivez un script shell infouser.sh qui permette de chercher si un utilisateur d'un nom donné existe sur votre machine, en affichant sa référence complète (c'est-à-dire sans aucun filtrage).
    + Le nom recherché sera passé comme paramètre au shell.
    + La recherche portera dans le fichier /etc/passwd.

    +

    Voir la solution

    +
    +

    ⚠ Comme d'habitude quand on veut traiter un fichier, il vaut mieux visionner son contenu, avant de vouloir l'exploiter (more /etc/passwd).

    +
    +
    #!/bin/sh
    +        grep $1 /etc/passwd
    +

  2. +
  3. Modifiez ce shell pour qu'il teste si un paramètre est bien passé en ligne.
    + En cas d'erreur (aucun paramètre ou plus d'un), un message sera affiché expliquant la bonne syntaxe à suivre.

    +

    Voir la solution

    +
    #!/bin/sh
    +        
    +        if test $# -ne 1
    +        then
    +          echo Mauvais nombre de parametres.
    +          echo
    +          echo Usage: $0 uid
    +          exit 1
    +        fi
    +        
    +        grep $1 /etc/passwd
    +

  4. +
+

Quelques manipulations sur un corpus XML

+

Pour cette partie du TP, il vous faut d'abord récupérer le corpus suivant : francis.exodic.xml

+

Ce fichier contient 20 notices en XML Exodic, dans une forme indentée, son exploration préparatoire est conseillée.

+
    +
  1. Écrivez un script shell qui compte le nombre de notices, en passant le nom de fichier en paramètre.
    + L'élément racine se nomme exodic.

    +

    Voir la solution

    +
    #!/bin/sh
    +        
    +        if test $# -ne 1
    +        then
    +          echo Mauvais nombre de parametres.
    +          echo
    +          echo Usage: $0 fichier
    +          exit 1
    +        fi
    +        
    +        NB_NOTICES=`cat $1 | grep "<exodic " | wc -l`
    +        
    +        echo Nombre de notices dans $1: ${NB_NOTICES}
    +

  2. +
  3. Modifiez le shell précédent pour qu'il teste en plus l'existence du fichier demandé avant traitement, puis pour qu'il sorte les résultats dans un fichier nommé resultats.txt.

    +

    Voir la solution

    +
    #!/bin/sh
    +        
    +        if test $# -ne 1
    +        then
    +          echo Mauvais nombre de parametres.
    +          echo
    +          echo Usage: $0 fichier
    +          exit 1
    +        fi
    +        
    +        if test ! -f $1
    +        then
    +          echo $1 "n'existe pas (ou n'est pas un fichier)."
    +          exit 2
    +        fi
    +        
    +        NB_NOTICES=`cat $1 | grep "<exodic " | wc -l`
    +        
    +        echo Nombre de notices dans $1: ${NB_NOTICES} > resultats.txt
    +
    +

    ⚠ Cette fois, on a mis la chaîne contenant les apostrophes (caractère spécial) entre guillemets pour les banaliser.

    +
    +

  4. +
  5. Installer et parcourir des fichiers dublin core d'un arbre de répertoires pour afficher le type de document des notices qui y sont présentes.
    + Il faut d'abord récupérer le fichier data_dc.tar.gz.

    +

    Votre shell devra décompresser puis installer l'archive du fichier tar sous Formation/TP_dc.
    + Cela donnera un répertoire dc contenant 5 répertoires nommés de 1 à 5.
    + Ces sous-répertoires contiennent chacun un fichier dublin_core.xml avec une seule notice (qu'il est conseillé d'aller regarder).

    +

    Ces opérations réalisées, la suite du shell devra chercher le type de document de chaque notice, identifiable avec dcvalue element="type".
    + Cette information trouvée, les résultats seront écrits dans le fichier typesDC.txt.

    +

    Voir la solution

    +
    #!/bin/sh
    +        
    +        # En etant dans le repertoire Formation/TP_dc
    +        gunzip data_dc.tar.gz
    +        tar -xvf data_dc.tar
    +        
    +        for FILE in dc/*/*.xml
    +        do
    +            cat $FILE | grep 'dcvalue element="type"' >> typesDC.txt
    +        done
    +
    +

    ⚠ Cette fois, on a mis la chaîne contenant les guillemets (caractère spécial) entre apostrophes pour les banaliser.

    +
    +
    +

    ⚠ On utilise une double redirection en sortie >> car il faut concaténer les différentes opérations d'écriture dans le fichier résultat.

    +
  6. +
  7. Écrivez un script shell qui utilise un fichier de clés de sélection avec grep sur un fichier de DOI, pour récupérer chaque sélection dans un fichier résultat différent.
    + Les noms de ces fichiers résultats contiendront la valeur de la clé de sélection. Le fichier de clés est listeCles.txt.
    + Le fichier à filtrer est listeDOI.txt.gz.

    +

    Voir la solution

    +
    #!/bin/sh
    +        
    +        export LC_COLLATE=C
    +        REP=.
    +        
    +        while read KEY
    +        do
    +            NAME=selection_$KEY
    +            zcat listeDOI.txt.gz | grep "$KEY" > ${REP}/$NAME.txt
    +        done < $REP/listeCles.txt
    +

    +
    +

    ⚠ Il est important de noter que, surtout pour le fichier des critères de sélection, le traitement se déroule sous Unix/Linux. Par conséquent, il faut prendre garde aux fins de ligne qui doivent être de type Unix (\n).
    + La présence de fins de ligne de type Windows (\r\n) perturbe les opérations de sélection comme avec grep (matching incorrect).

    +
  8. +
+

Précédent - Suivant

+
+ + + + + \ No newline at end of file diff --git a/output/style.css b/output/style.css new file mode 100644 index 0000000..b24537d --- /dev/null +++ b/output/style.css @@ -0,0 +1 @@ +@import url(//fonts.googleapis.com/css?family=Libre+Baskerville:400,400italic,700);@import url(//fonts.googleapis.com/css?family=Source+Code+Pro:400,400italic,700,700italic);/* normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}body,code,tr.odd,tr.even,figure{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAABOFBMVEWDg4NycnJnZ2ebm5tjY2OgoKCurq5lZWWoqKiKiopmZmahoaGOjo5TU1N6enp7e3uRkZGJiYmFhYWxsbFOTk6Xl5eBgYGkpKRhYWFRUVGvr69dXV2wsLBiYmKnp6dUVFR5eXmdnZ1sbGxYWFh2dnZ0dHSmpqaZmZlVVVVqamqsrKyCgoJ3d3dubm5fX19tbW2ioqKSkpJWVlaHh4epqalSUlKTk5OVlZWysrJoaGhzc3N+fn5wcHBaWlqcnJxkZGRpaWlvb2+zs7NcXFxPT09/f3+lpaWWlpaQkJCjo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UVXSMqpTH8Da3gCNr8maodNIxjY7CXyvzHHfiJoto/CE9UMmX+cRqPC8RKdks7OV35txMGkdXzOkkhX9wTr+tIOGKZzjoo+qbWy3hsJJtz5D7nP+syyjxYe7eCAMIOywwFNfv/ZMNyBSxV0g7ZEJCPVE8IA5sw7jg9Kx3RXdfCQXGxpH+0kyHYpBj0H4y2VdAHRW9RyegOPPB+5NudysJji/lnxHQ9pFOMLMLeZ0O9hrnsuFsstbjczbC+14JHS+xsDf3pPgQXvUG6Q/H2fKV/B7jYX8RdOrug5BjG/1jueAPq1ElQb4AeH/sRNwnNyoFqsJwT9tWhChzL/IP/gxfleLSIgVQDdRvKBZVfu9wgKkeHEEfgIqa/F6fJ0HM8knJtkbCn4hKFvNDLWXDr8BGMywGD1Lh54AAAAASUVORK5CYII=")}body{font-family:"Libre Baskerville",Baskerville,Georgia,serif;background-color:#f8f8f8;color:#111;line-height:1.3;text-align:justify;-moz-hyphens:auto;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}@media (max-width: 400px){body{font-size:12px;margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:15px}}@media (min-width: 401px) and (max-width: 600px){body{font-size:14px;margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:15px}}@media (min-width: 601px) and (max-width: 900px){body{font-size:15px;margin-left:100px;margin-right:100px;margin-top:20px;margin-bottom:25px}}@media (min-width: 901px) and (max-width: 1800px){body{font-size:17px;margin-left:200px;margin-right:200px;margin-top:30px;margin-bottom:25px;max-width:800px}}@media (min-width: 1801px){body{font-size:18px;margin-left:20%;margin-right:20%;margin-top:30px;margin-bottom:25px;max-width:1000px}}p{margin-top:10px;margin-bottom:18px}em{font-style:italic}strong{font-weight:bold}h1,h2,h3,h4,h5,h6{font-weight:bold;padding-top:0.25em;margin-bottom:0.15em}header{line-height:2.475em;padding-bottom:0.7em;border-bottom:1px solid #bbb;margin-bottom:1.2em}header>h1{border:none;padding:0;margin:0;font-size:225%}header>h2{border:none;padding:0;margin:0;font-style:normal;font-size:175%}header>h3{padding:0;margin:0;font-size:125%;font-style:italic}header+h1{border-top:none;padding-top:0px}h1{border-top:1px solid #bbb;padding-top:15px;font-size:150%;margin-bottom:10px}h1:first-of-type{border:none}h2{font-size:125%;font-style:italic}h3{font-size:105%;font-style:italic}hr{border:0px;border-top:1px solid #bbb;width:100%;height:0px}hr+h1{border-top:none;padding-top:0px}ul,ol{font-size:90%;margin-top:10px;margin-bottom:15px;padding-left:30px}ul{list-style:circle}ol{list-style:decimal}ul ul,ol ol,ul ol,ol ul{font-size:inherit}li{margin-top:5px;margin-bottom:7px}q,blockquote,dd{font-style:italic;font-size:90%}blockquote,dd{quotes:none;border-left:0.35em #bbb solid;padding-left:1.15em;margin:0 1.5em 0 0}blockquote blockquote,dd blockquote,blockquote dd,dd dd,ol blockquote,ol dd,ul blockquote,ul dd,blockquote ol,dd ol,blockquote ul,dd ul{font-size:inherit}a,a:link,a:visited,a:hover{color:inherit;text-decoration:none;border-bottom:1px dashed #111}a:hover,a:link:hover,a:visited:hover,a:hover:hover{border-bottom-style:solid}a.footnoteRef,a:link.footnoteRef,a:visited.footnoteRef,a:hover.footnoteRef{border-bottom:none;color:#666}code{font-family:"Source Code Pro","Consolas","Monaco",monospace;font-size:85%;background-color:#ddd;border:1px solid #bbb;padding:0px 0.15em 0px 0.15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}pre{margin-right:1.5em;display:block}pre>code{display:block;font-size:70%;padding:10px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;overflow-x:auto}blockquote pre,dd pre,ul pre,ol pre{margin-left:0;margin-right:0}blockquote pre>code,dd pre>code,ul pre>code,ol pre>code{font-size:77.77778%}caption,figcaption{font-size:80%;font-style:italic;text-align:right;margin-bottom:5px}caption:empty,figcaption:empty{display:none}table{width:100%;margin-top:1em;margin-bottom:1em}table+h1{border-top:none}tr td,tr th{padding:0.2em 0.7em}tr.header{border-top:1px solid #222;border-bottom:1px solid #222;font-weight:700}tr.odd{background-color:#eee}tr.even{background-color:#ccc}tbody:last-child{border-bottom:1px solid #222}dt{font-weight:700}dt:after{font-weight:normal;content:":"}dd{margin-bottom:10px}figure{margin:1.3em 0 1.3em 0;text-align:center;padding:0px;width:100%;background-color:#ddd;border:1px solid #bbb;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;overflow:hidden}img{display:block;margin:0px auto;padding:0px;max-width:100%}figcaption{margin:5px 10px 5px 30px}.footnotes{color:#666;font-size:70%;font-style:italic}.footnotes li p:last-child a:last-child{border-bottom:none} diff --git a/output/unix/README.html b/output/unix/README.html new file mode 100644 index 0000000..9865fe8 --- /dev/null +++ b/output/unix/README.html @@ -0,0 +1,44 @@ + + + + + + + + + +
+

+ +
+ +
+

UNIX

+

UNIX est un système d'exploitation (au même titre que Windows, MS-DOS, MacOS, etc.)

+

Ses principales caractéristiques sont les suivantes :

+ +

Ces caractéristiques ont été de plus en plus présentes dans les systèmes d'exploitation modernes (alors que ça fait 50 ans qu'UNIX les possède).

+

Précédent - Suivant

+
+ + + + + \ No newline at end of file diff --git a/output/unix/historique.html b/output/unix/historique.html new file mode 100644 index 0000000..04050b1 --- /dev/null +++ b/output/unix/historique.html @@ -0,0 +1,119 @@ + + + + + + + + + +
+

+ +
+ +
+

Historique

+

Année

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Année
1969AT&T Bell Laboratories (Ken Thompson, Dennis Ritchie), PDP7
197210 UNIX installés
1973ré-écrit en C (portabilité)
1979Bourne shell
1983AT&T UNIX System V
1984TCP/IP sur 4.2 BSD → Internet, 100 000 UNIX installés
1987750 000 UNIX installés
1991Linux en développement (par Linus Torvalds)
1993Novell rachète UNIX à AT&T
1995SCO rachète UNIX à Novell
1999Linux 2.2
2001Linux 2.4
200318 millions de Linux installés (estimation du linuxcounter)
+

Implications

+ +

Versions

+ +

Précédent - Suivant

+
+ + + + + \ No newline at end of file diff --git a/output/unix/linux.html b/output/unix/linux.html new file mode 100644 index 0000000..84dac05 --- /dev/null +++ b/output/unix/linux.html @@ -0,0 +1,54 @@ + + + + + + + + + +
+

+ +
+ +
+

Linux

+

Toutes les distributions de Linux, basé sur UNIX, utilisent le noyau Linux qui a été créé en 1991 par Linus Torvalds (essentiellement développé en langage C).
+ Voir pour plus de détails le Noyau Linux sur Wikipedia.

+

Ce qui change dans les distributions, c'est la facilité d'installation, les programmes fournis, la facilité de configuration, les architectures visées, ...

+

Voici une liste des distributions les plus célèbres :

+ +

Références

+ +

Précédent - Suivant

+
+ + + + + \ No newline at end of file diff --git a/output/unix/style.css b/output/unix/style.css new file mode 100644 index 0000000..b24537d --- /dev/null +++ b/output/unix/style.css @@ -0,0 +1 @@ +@import url(//fonts.googleapis.com/css?family=Libre+Baskerville:400,400italic,700);@import url(//fonts.googleapis.com/css?family=Source+Code+Pro:400,400italic,700,700italic);/* normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}body,code,tr.odd,tr.even,figure{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAABOFBMVEWDg4NycnJnZ2ebm5tjY2OgoKCurq5lZWWoqKiKiopmZmahoaGOjo5TU1N6enp7e3uRkZGJiYmFhYWxsbFOTk6Xl5eBgYGkpKRhYWFRUVGvr69dXV2wsLBiYmKnp6dUVFR5eXmdnZ1sbGxYWFh2dnZ0dHSmpqaZmZlVVVVqamqsrKyCgoJ3d3dubm5fX19tbW2ioqKSkpJWVlaHh4epqalSUlKTk5OVlZWysrJoaGhzc3N+fn5wcHBaWlqcnJxkZGRpaWlvb2+zs7NcXFxPT09/f3+lpaWWlpaQkJCjo6OIiIitra2enp6YmJhQUFBZWVmqqqqLi4uNjY1eXl6rq6ufn599fX2AgIB8fHyEhIRxcXFra2tbW1uPj4+MjIyGhoaamppgYGB4eHhNTU1XV1d1dXW0tLSUlJSHWuNDAAAAaHRSTlMNDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ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eH/sRNwnNyoFqsJwT9tWhChzL/IP/gxfleLSIgVQDdRvKBZVfu9wgKkeHEEfgIqa/F6fJ0HM8knJtkbCn4hKFvNDLWXDr8BGMywGD1Lh54AAAAASUVORK5CYII=")}body{font-family:"Libre Baskerville",Baskerville,Georgia,serif;background-color:#f8f8f8;color:#111;line-height:1.3;text-align:justify;-moz-hyphens:auto;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}@media (max-width: 400px){body{font-size:12px;margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:15px}}@media (min-width: 401px) and (max-width: 600px){body{font-size:14px;margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:15px}}@media (min-width: 601px) and (max-width: 900px){body{font-size:15px;margin-left:100px;margin-right:100px;margin-top:20px;margin-bottom:25px}}@media (min-width: 901px) and (max-width: 1800px){body{font-size:17px;margin-left:200px;margin-right:200px;margin-top:30px;margin-bottom:25px;max-width:800px}}@media (min-width: 1801px){body{font-size:18px;margin-left:20%;margin-right:20%;margin-top:30px;margin-bottom:25px;max-width:1000px}}p{margin-top:10px;margin-bottom:18px}em{font-style:italic}strong{font-weight:bold}h1,h2,h3,h4,h5,h6{font-weight:bold;padding-top:0.25em;margin-bottom:0.15em}header{line-height:2.475em;padding-bottom:0.7em;border-bottom:1px solid #bbb;margin-bottom:1.2em}header>h1{border:none;padding:0;margin:0;font-size:225%}header>h2{border:none;padding:0;margin:0;font-style:normal;font-size:175%}header>h3{padding:0;margin:0;font-size:125%;font-style:italic}header+h1{border-top:none;padding-top:0px}h1{border-top:1px solid #bbb;padding-top:15px;font-size:150%;margin-bottom:10px}h1:first-of-type{border:none}h2{font-size:125%;font-style:italic}h3{font-size:105%;font-style:italic}hr{border:0px;border-top:1px solid #bbb;width:100%;height:0px}hr+h1{border-top:none;padding-top:0px}ul,ol{font-size:90%;margin-top:10px;margin-bottom:15px;padding-left:30px}ul{list-style:circle}ol{list-style:decimal}ul ul,ol ol,ul ol,ol ul{font-size:inherit}li{margin-top:5px;margin-bottom:7px}q,blockquote,dd{font-style:italic;font-size:90%}blockquote,dd{quotes:none;border-left:0.35em #bbb solid;padding-left:1.15em;margin:0 1.5em 0 0}blockquote blockquote,dd blockquote,blockquote dd,dd dd,ol blockquote,ol dd,ul blockquote,ul dd,blockquote ol,dd ol,blockquote ul,dd ul{font-size:inherit}a,a:link,a:visited,a:hover{color:inherit;text-decoration:none;border-bottom:1px dashed #111}a:hover,a:link:hover,a:visited:hover,a:hover:hover{border-bottom-style:solid}a.footnoteRef,a:link.footnoteRef,a:visited.footnoteRef,a:hover.footnoteRef{border-bottom:none;color:#666}code{font-family:"Source Code Pro","Consolas","Monaco",monospace;font-size:85%;background-color:#ddd;border:1px solid #bbb;padding:0px 0.15em 0px 0.15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}pre{margin-right:1.5em;display:block}pre>code{display:block;font-size:70%;padding:10px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;overflow-x:auto}blockquote pre,dd pre,ul pre,ol pre{margin-left:0;margin-right:0}blockquote pre>code,dd pre>code,ul pre>code,ol pre>code{font-size:77.77778%}caption,figcaption{font-size:80%;font-style:italic;text-align:right;margin-bottom:5px}caption:empty,figcaption:empty{display:none}table{width:100%;margin-top:1em;margin-bottom:1em}table+h1{border-top:none}tr td,tr th{padding:0.2em 0.7em}tr.header{border-top:1px solid #222;border-bottom:1px solid #222;font-weight:700}tr.odd{background-color:#eee}tr.even{background-color:#ccc}tbody:last-child{border-bottom:1px solid #222}dt{font-weight:700}dt:after{font-weight:normal;content:":"}dd{margin-bottom:10px}figure{margin:1.3em 0 1.3em 0;text-align:center;padding:0px;width:100%;background-color:#ddd;border:1px solid #bbb;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;overflow:hidden}img{display:block;margin:0px auto;padding:0px;max-width:100%}figcaption{margin:5px 10px 5px 30px}.footnotes{color:#666;font-size:70%;font-style:italic}.footnotes li p:last-child a:last-child{border-bottom:none} diff --git a/shell/scripts.md b/shell/scripts.md index ba657e9..a6bc036 100644 --- a/shell/scripts.md +++ b/shell/scripts.md @@ -1,4 +1,4 @@ -# Scripts - Shell -UNIX +# Scripts - Shell - UNIX Un fichier script contenant des commandes shell (par exemple des initialisations de variables, une automatisation de tâches,...) peut être exécuté : diff --git a/template/style.css b/template/style.css new file mode 100644 index 0000000..b24537d --- /dev/null +++ b/template/style.css @@ -0,0 +1 @@ +@import url(//fonts.googleapis.com/css?family=Libre+Baskerville:400,400italic,700);@import url(//fonts.googleapis.com/css?family=Source+Code+Pro:400,400italic,700,700italic);/* normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}body,code,tr.odd,tr.even,figure{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAABOFBMVEWDg4NycnJnZ2ebm5tjY2OgoKCurq5lZWWoqKiKiopmZmahoaGOjo5TU1N6enp7e3uRkZGJiYmFhYWxsbFOTk6Xl5eBgYGkpKRhYWFRUVGvr69dXV2wsLBiYmKnp6dUVFR5eXmdnZ1sbGxYWFh2dnZ0dHSmpqaZmZlVVVVqamqsrKyCgoJ3d3dubm5fX19tbW2ioqKSkpJWVlaHh4epqalSUlKTk5OVlZWysrJoaGhzc3N+fn5wcHBaWlqcnJxkZGRpaWlvb2+zs7NcXFxPT09/f3+lpaWWlpaQkJCjo6OIiIitra2enp6YmJhQUFBZWVmqqqqLi4uNjY1eXl6rq6ufn599fX2AgIB8fHyEhIRxcXFra2tbW1uPj4+MjIyGhoaamppgYGB4eHhNTU1XV1d1dXW0tLSUlJSHWuNDAAAAaHRSTlMNDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDUnKohIAAAaZSURBVHhelZWFrmZVDEb3cffzq7u7u7u7u9z7/m8AhISQwMDMAzRN2/WtAhO7zOd0x0U/UNb0oWQZGLWhIHBK/lC96klgkA+3B5JoqI9ozRcn4306YeDweKG9vxo5YbGbqBkln93ZFGs3SA0RRpSO4dpdpg+VnMUv8BEqmiI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rXVTwJjLAphVEKq7HS2d8pSqoZdCBAv6mdJ72revxET6giWB7PgbJph+2i011uUifL7xruTb3zv+NKvgpqRSU0yBSckeKeQzSgeZZcaQb8+JYzehtPraBkg3Jc3e8boxVXJzNW23deFoZ74Vzy6xd1+FemwZ/neOnHQh2ufopy5c/r69Cz+scIrx+uN+dzhyzEjCeNLL0hgjGUOHdvb25YDijfq/An/D+iv7BBDutUsyuvBrH2ya6j2SIkLvjxFIpk8H37wcAt9KHX9cLeNmn+8CR1xtKgrzojVXl/qikMqAsDcO1coQrEanpsrB3DlAImIwS07oN2k3C2x2jSE3jxSm908P1tUXUMD15Lpp50CHii7i2BDSdYMcfB7+X7QdqymsDWH6BJ5APN+qIRhTVc/msYf5CjOyA82VSuIEtZA3GmUuXBK2r6xJ2LXO8fCU9kmCvydDptoECLq+XXLs4w8U+DUZyir9Cw+XL3rHFGoDNI9Rw3baFy/fZwTY2Gr0WMuLaxMrWaC5rh+IeyZijp0fdaDLPg8YtugLgnwYZss1xIh1o13qB7L8pC6wEutNQVuy5aIpNkSSl2yWAiRADUVXSMqpTH8Da3gCNr8maodNIxjY7CXyvzHHfiJoto/CE9UMmX+cRqPC8RKdks7OV35txMGkdXzOkkhX9wTr+tIOGKZzjoo+qbWy3hsJJtz5D7nP+syyjxYe7eCAMIOywwFNfv/ZMNyBSxV0g7ZEJCPVE8IA5sw7jg9Kx3RXdfCQXGxpH+0kyHYpBj0H4y2VdAHRW9RyegOPPB+5NudysJji/lnxHQ9pFOMLMLeZ0O9hrnsuFsstbjczbC+14JHS+xsDf3pPgQXvUG6Q/H2fKV/B7jYX8RdOrug5BjG/1jueAPq1ElQb4AeH/sRNwnNyoFqsJwT9tWhChzL/IP/gxfleLSIgVQDdRvKBZVfu9wgKkeHEEfgIqa/F6fJ0HM8knJtkbCn4hKFvNDLWXDr8BGMywGD1Lh54AAAAASUVORK5CYII=")}body{font-family:"Libre Baskerville",Baskerville,Georgia,serif;background-color:#f8f8f8;color:#111;line-height:1.3;text-align:justify;-moz-hyphens:auto;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}@media (max-width: 400px){body{font-size:12px;margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:15px}}@media (min-width: 401px) and (max-width: 600px){body{font-size:14px;margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:15px}}@media (min-width: 601px) and (max-width: 900px){body{font-size:15px;margin-left:100px;margin-right:100px;margin-top:20px;margin-bottom:25px}}@media (min-width: 901px) and (max-width: 1800px){body{font-size:17px;margin-left:200px;margin-right:200px;margin-top:30px;margin-bottom:25px;max-width:800px}}@media (min-width: 1801px){body{font-size:18px;margin-left:20%;margin-right:20%;margin-top:30px;margin-bottom:25px;max-width:1000px}}p{margin-top:10px;margin-bottom:18px}em{font-style:italic}strong{font-weight:bold}h1,h2,h3,h4,h5,h6{font-weight:bold;padding-top:0.25em;margin-bottom:0.15em}header{line-height:2.475em;padding-bottom:0.7em;border-bottom:1px solid #bbb;margin-bottom:1.2em}header>h1{border:none;padding:0;margin:0;font-size:225%}header>h2{border:none;padding:0;margin:0;font-style:normal;font-size:175%}header>h3{padding:0;margin:0;font-size:125%;font-style:italic}header+h1{border-top:none;padding-top:0px}h1{border-top:1px solid #bbb;padding-top:15px;font-size:150%;margin-bottom:10px}h1:first-of-type{border:none}h2{font-size:125%;font-style:italic}h3{font-size:105%;font-style:italic}hr{border:0px;border-top:1px solid #bbb;width:100%;height:0px}hr+h1{border-top:none;padding-top:0px}ul,ol{font-size:90%;margin-top:10px;margin-bottom:15px;padding-left:30px}ul{list-style:circle}ol{list-style:decimal}ul ul,ol ol,ul ol,ol ul{font-size:inherit}li{margin-top:5px;margin-bottom:7px}q,blockquote,dd{font-style:italic;font-size:90%}blockquote,dd{quotes:none;border-left:0.35em #bbb solid;padding-left:1.15em;margin:0 1.5em 0 0}blockquote blockquote,dd blockquote,blockquote dd,dd dd,ol blockquote,ol dd,ul blockquote,ul dd,blockquote ol,dd ol,blockquote ul,dd ul{font-size:inherit}a,a:link,a:visited,a:hover{color:inherit;text-decoration:none;border-bottom:1px dashed #111}a:hover,a:link:hover,a:visited:hover,a:hover:hover{border-bottom-style:solid}a.footnoteRef,a:link.footnoteRef,a:visited.footnoteRef,a:hover.footnoteRef{border-bottom:none;color:#666}code{font-family:"Source Code Pro","Consolas","Monaco",monospace;font-size:85%;background-color:#ddd;border:1px solid #bbb;padding:0px 0.15em 0px 0.15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}pre{margin-right:1.5em;display:block}pre>code{display:block;font-size:70%;padding:10px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;overflow-x:auto}blockquote pre,dd pre,ul pre,ol pre{margin-left:0;margin-right:0}blockquote pre>code,dd pre>code,ul pre>code,ol pre>code{font-size:77.77778%}caption,figcaption{font-size:80%;font-style:italic;text-align:right;margin-bottom:5px}caption:empty,figcaption:empty{display:none}table{width:100%;margin-top:1em;margin-bottom:1em}table+h1{border-top:none}tr td,tr th{padding:0.2em 0.7em}tr.header{border-top:1px solid #222;border-bottom:1px solid #222;font-weight:700}tr.odd{background-color:#eee}tr.even{background-color:#ccc}tbody:last-child{border-bottom:1px solid #222}dt{font-weight:700}dt:after{font-weight:normal;content:":"}dd{margin-bottom:10px}figure{margin:1.3em 0 1.3em 0;text-align:center;padding:0px;width:100%;background-color:#ddd;border:1px solid #bbb;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;overflow:hidden}img{display:block;margin:0px auto;padding:0px;max-width:100%}figcaption{margin:5px 10px 5px 30px}.footnotes{color:#666;font-size:70%;font-style:italic}.footnotes li p:last-child a:last-child{border-bottom:none} diff --git a/template/template.html b/template/template.html new file mode 100644 index 0000000..d572461 --- /dev/null +++ b/template/template.html @@ -0,0 +1,34 @@ + + + + + $title$ + + + + +
+

$title$

+ +
+ +
+ $body$ +
+ + + + + \ No newline at end of file