diff --git a/README.md b/README.md index 7736a9e..d9851c2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,23 @@ cours-unix-shell =============== -Reprise d'un ancien cours UNIX/Shell \ No newline at end of file +Reprise d'un [ancien cours UNIX/Shell](./UnixShell_cours2018/), dédié à des +formations internes pour +l'[Inist](http://www.inist.fr/)-[CNRS](http://www.cnrs.fr/). + +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. bases: redirections et commandes de base à connaître, +3. commandes: diverses commandes UNIX utiles, +4. shell: initiation pour la programmation de scripts shell, +5. sed: substitution de textes via l'éditeur de chaînes de caractères non + interactif. +6. make: outil qui fait gagner du temps en ne réitérant pas des calculs qui ne + sont plus nécessaires. diff --git a/UnixShell_cours2018/Make.gif b/UnixShell_cours2018/Make.gif new file mode 100644 index 0000000..3f48c45 --- /dev/null +++ b/UnixShell_cours2018/Make.gif Binary files differ diff --git a/UnixShell_cours2018/Shell.gif b/UnixShell_cours2018/Shell.gif new file mode 100644 index 0000000..a5669f0 --- /dev/null +++ b/UnixShell_cours2018/Shell.gif Binary files differ diff --git a/UnixShell_cours2018/Unix.txt b/UnixShell_cours2018/Unix.txt new file mode 100644 index 0000000..0fd2109 --- /dev/null +++ b/UnixShell_cours2018/Unix.txt @@ -0,0 +1,360 @@ +$Id: Unix.txt,v 1.9 2003/05/13 16:03:01 parmentf Exp $ + + ------------ + UNIX + ------------ + +Historique --------------------------------------- + +Multics --> UNICS --> UNIX +(MULTiplexed Information and Computing Service) +(UNiplexed Information and Computing Service) + +1969 / AT&T Bell Laboratories (Ken Thompson, Dennis Ritchie) / PDP7 + +1972 / 10 UNIX install�s + +1973 / r�-�crit en C / portabilit� + +1979 / Bourne shell + +1983 / AT&T UNIX System V + +1984 / TCP/IP sur 4.2BSD --> Internet + / 100 000 UNIX install�s + +1987 / 750 000 UNIX install�s + +1991 / Linux en d�veloppement (par Linus Torvalds) + +1999 / Linux 2.2 + +2001 / Linux 2.4 + +Implications: + +Internet, Jurassic Park, Open Source, ... + +http://www.unix-systems.org/what_is_unix/history_timeline.html + +Diff�rents UNIX: + +HP-UX, Solaris (Sun), (DEC), AIX (IBM), Xenix (Microsoft, abandonn�), +IRIX (SGI), BSD (Berkeley), FreeBSD, Linux, MacOS X (Apple), QNX, ... + + +Cas de Linux: + +Le noyau est le m�me 2.2, 2.4 ou 2.6 (dernier num�ro pair: version +stable, impair: version de d�veloppement), mais les distributions +changent (facilit�s d'installation, programmes fournis, facilit�s de +configuration, ...): RedHat, Mandrake, SuSE, UnitedLinux (SCO, SuSE, +TurboLinux, Conectiva), Slackware, Debian, ... +Gratuit et sources fournies. + +http://www.linux-france.org/ +http://www.linux.org/ +http://lea-linux.org/intro/ (Linux Entre Amis) +http://www.delafond.org/survielinux/ (Guide de survie du d�butant sous +Linux) + + +Caract�ristiques --------------------------------- + +UNIX est un syst�me d'exploitation: +- portable (de nombreuses architectures support�es) +- r�seau (on peut se connecter � une machine distante et y ex�cuter +des programmes, pour peu qu'on puisse s'y loguer). +- multi-t�ches (plusieurs programmes peuvent tourner en m�me temps, ce +qui n'�tait pas le cas de Windows 3 - pas r�ellement, ni celui de de +MacOS < 10) +- multi-utilisateurs (plusieurs utilisateurs peuvent utiliser la m�me +machine en m�me temps). + +Ces caract�ristiques sont de plus en plus pr�sentes dans les syst�mes +d'exploitation modernes (alors que �a fait plus de 30 ans qu'UNIX les +poss�de). +ex: Windows NT-2000-XP, MacOS X, Linux, Amiga, ... + + +X Window System ---------------------------------- + +X Window (appel� aussi "X" ou "x11") est la couche graphique des +syst�mes bas�s sur Unix. Elle est la m�me sur nombre de syst�mes +d'exploitation diff�rents, et tient compte du r�seau. + +X Window a une architecture client/serveur: une application graphique +est consid�r�e comme un client d'un serveur X (c'est-�-dire le +programme qui affiche les donn�es sur l'�cran du poste de travail). + +Exemple de serveurs X: +- XWin +- XFree86 (pour Linux, Cygwin, ...) +- ... + +http://www.x.org/X11.html +http://www.xfree.org/ +http://www.linux-kheops.com/doc/casteyde/install_guide-2.0.2/htm/c8074.htm#AEN8093 + + +La plupart des commandes Unix se manipulent en mode texte. +Certaines des applications aussi. +D'autres ne fonctionne qu'en mode graphique (sous X). +Certaines fonctionnent dans les 2 modes (�a d�pend de ce qui est +disponible): emacs est de celles-l�. + +Emacs -------------------------------------------- + +http://www.parinux.org/ressources/mini-howtos/emacs/ + +Window Managers ---------------------------------- + +Le "look-and-feel" de X est configurable: on peut utiliser plusieurs +"Window managers" (contrairement � Windows, o� l'on n'a pas le choix +de l'interface graphique, m�me si on peut configurer un peu les +couleurs, les comportements -- avec TweakUI). + +http://www.xwinman.org/ + +� garder en r�serve. + + +Commandes ---------------------------------------- + + +http://www.linux-france.org/article/debutant/ + + +Shell -------------------------------------------- + +Nous ne verrons ici que le shell sh (aussi appel� Bourne Shell), avec +lequel ksh est compatible (ksh est le shell par d�faut � l'INIST). + +-- variables d'environnement --- + +HOME +PATH +PS1 +SHELL + +-- ex�cution d'un script -- + +sh +#!/bin/sh +. + +-- les variables d'un script -- + +variable=valeur +$variable +${variable} +export variable + +-- les param�tres -- + +$0 +$n +$# +$* +shift + +-- variables sp�ciales -- + +$$ +$? + +-- caract�res sp�ciaux -- + +\ +"..." +'...' +`...` + +-- instructions -- + +case +test +if +while +until +for + +-- diverses commandes -- + +# +banner +echo +read +exit +. script +fonction() +exec arg + +-- expr -- + +expr e1 op e2 +expr e1 \| e2 +expr e1 \& e2 +expr e1 : regexp + + +http://www.shellunix.com/ (en fran�ais) + + +Make --------------------------------------------- + +make < GNU make (GNU make est celui qu'on utilise � l'INIST) + +make est un programme qui permet de gagner du temps. + +Il arrive qu'on construise de gros shells qui, traitent un corpus, en +extraient des informations, et/ou en font une synth�se. + +Or, d�s que le corpus change, ou que les param�tre de traitement +changent (par exemple, une table de r�f�rence), quand on n'a pas make, +on relance le shell. Dans ce cas on relance un traitement qui n'aurait +pas forc�ment besoin d'�tre ex�cut� *depuis le d�but*. + +Pour pallier � ce probl�me, on peut aussi d�couper ce gros shell en +plusieurs petits, mais il subsiste un �cueil: il faut s'assurer qu'on +a bien ex�cut� tous les shells n�cessaire � la prise en compte des +derni�res modifications. + +Make est l� pour r�pondre � tous ces besoins: gr�ce aux dates de +modification des fichiers, et � une liste de d�pendences entre +fichiers de d�part et fichiers d'arriv�e, il simplifie la reg�n�ration +de fichiers (sans qu'on aie � tenir une liste des fichiers modifi�s, +et donc des shells � ex�cuter). + +De plus, make est un programme g�n�rique, qui peut �tre appliqu� � +bien d'autres programmes que de simples shells. On s'en sert par +exemple pour compiler de gros projets (pour avoir un programme � jour, +il faut qu'il soit recompiler d�s qu'un des fichiers dont il d�pend +est modifi�). + +-- + +Par d�faut, make utilise le fichier makefile pr�sent dans le +r�pertoire courant. Ce fichier doit contenir les r�gles de d�pendances +entre fichiers � g�n�rer et fichiers de base (un fichier peut +appartenir aux deux cat�gories, mais dans des r�gles diff�rentes), et +les commandes � ex�cuter pour obtenir les fichiers � g�n�rer. + +une r�gle est de la forme: + +cible: base + commande + +O� la commande doit �tre pr�c�d�e d'une tabulation! Il peut y avoir +plusieurs lignes de commandes, et plusieurs fichiers de base. + +Pour cr�er le fichier cible (qui est une r�gle du fichier makefile), +il suffit de taper: make cible. + +http://www.eng.hawaii.edu/Tutor/Make/FrenchMake/make.htm +http://www.oreillynet.com/pub/a/linux/2002/01/31/make_intro.html +http://www.gnu.org/manual/make/ +http://make.paulandlesley.org/ + + +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. + +Substitution ------- + +La commande suivante lit et affiche ses lignes sur la sortie +standard en rempla�ant la cha�ne Dilib par la cha�ne DILIB. + +sed 's/Dilib/DILIB/' fichier + +Il est conseill� d'entourer les commandes par des apostrophes simples, +pour �viter que le shell n'interpr�te les caract�res sp�ciaux ( +.*[]^$\ ). + +ATTENTION: 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' fichier + +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' fichier + +ATTENTION: le -e est obligatoire pour distinguer la deuxi�me commande +d'un nom de fichier. + +REMARQUE: 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. + +Expression 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). + +Exemple: +sed -e 's/Jacques D[uU][cC][lL][oO][yY]/Monsieur Dilib/g' fichier + +REMARQUE: 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 pas 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. + +Commandes dans un fichier ------------------------ + +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/�/É/g +s/�/À/g +s/�/Ç/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 +s/�/É/g +s/�/À/g +s/�/Ç/g + + +http://www.shellunix.com/sed.html La commande sed +http://www.cs.hmc.edu/qref/sed.html An introduction to sed diff --git a/UnixShell_cours2018/X.fre.html b/UnixShell_cours2018/X.fre.html new file mode 100644 index 0000000..67116de --- /dev/null +++ b/UnixShell_cours2018/X.fre.html @@ -0,0 +1,138 @@ + + + + + + X Window System - UNIX + + + + + + + + + +

X Window System : couche graphique

+ + + +
+

+ A NOTER : Page non remise à jour. +

+

+ X Window (appelé aussi "X" ou "x11") est la couche + graphique des systèmes basés sur Unix. Elle est la + même sur nombre de systèmes d'exploitation + différents, et tient compte du réseau. +

+

+ X Window a une architecture client/serveur : une + application graphique est considérée comme un + client d'un serveur X (c'est-à-dire le programme qui + affiche les données sur l'écran du poste de + travail). +

+

+ Exemples de serveurs X : +

+ + +

Références

+ + + +
+ +

Emacs

+

+ La plupart des commandes Unix se manipulent en mode texte. + Certaines des applications aussi. D'autres ne fonctionne qu'en + mode graphique (sous X). Certaines fonctionnent dans les 2 + modes (ça dépend de ce qui est disponible): + emacs est de celles-là. +

+

Références

+ + +
+ +

Window Manager

+

+ Le look-and-feel de X est configurable : on peut + utiliser plusieurs Window managers (contrairement + à Windows, où l'on n'a pas le choix de l'interface + graphique, même si on peut configurer un peu les couleurs, + les comportements -- avec TweakUI, par exemple). +

+ + + + + + + +
+ Gnome screenshot +
+ kde screenshot +
+ xfce screenshot +
+ +

Référence

+ +
+
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/cacher.js b/UnixShell_cours2018/cacher.js new file mode 100644 index 0000000..318836c --- /dev/null +++ b/UnixShell_cours2018/cacher.js @@ -0,0 +1,31 @@ +/* $Id: cacher.js,v 1.1 2003/09/04 15:58:22 parmentf Exp $ */ +/* le nom du fichier contenant le corrig� �quivalent + � celui de ce fichier doit se trouver dans une variable globale corrige */ +/* ex: + var corrige='makefile.$LANGUE.html'; +*/ + +function Montrer(divId) { + if(document.getElementById && document.styleSheets) { + document.getElementById(divId).style.display='block'; + document.getElementById("action"+divId).style.display='none'; + } +} + +function Cacher(divId) { + if(document.getElementById && document.styleSheets) { + document.getElementById(divId).style.display='none'; + document.getElementById("action"+divId).style.display='block'; + } +} + +function EcrireBouton(divId) { + if(document.getElementById && document.styleSheets) { + document.writeln('
'); + document.writeln(' Voir la solution'); + document.writeln('
'); + } + else { + document.writeln('

Voir la solution

'); + } +} diff --git a/UnixShell_cours2018/caracteristiques.fre.html b/UnixShell_cours2018/caracteristiques.fre.html new file mode 100644 index 0000000..4eebef3 --- /dev/null +++ b/UnixShell_cours2018/caracteristiques.fre.html @@ -0,0 +1,85 @@ + + + + + Caractéristiques d'UNIX + + + + + + + + +

Caractéristiques d'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). +

+ + +
+ +
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/commandeShell.fre.html b/UnixShell_cours2018/commandeShell.fre.html new file mode 100644 index 0000000..81f15cc --- /dev/null +++ b/UnixShell_cours2018/commandeShell.fre.html @@ -0,0 +1,156 @@ + + + + + + + Commandes diverses - Shell - UNIX + + + + + + + + + +

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 || cmd2 + séparateur conditionnel (cmd2 est exécutée même si cmd1 ne + s'est pas exécutée correctement) +
set + liste 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 fichier + change 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 (op peut + valoir +, -, \*, /, %, =, \>, \<, \>=, \<=, + !=) +
+

+ 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`
+
+
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/commandesBase.fre.html b/UnixShell_cours2018/commandesBase.fre.html new file mode 100644 index 0000000..f667902 --- /dev/null +++ b/UnixShell_cours2018/commandesBase.fre.html @@ -0,0 +1,221 @@ + + + + + Commandes de base - UNIX + + + + + + + + + + + +

Commandes de base Unix

+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
nomsyntaxedéfinitionexemple
cat
cat [file]
Lecture du contenu de fichierscat file.txt
cat
cat [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 relatifs
+ cd
+ cd Formation/TP1
+ cd -
cpcp inputFile targetFile Copie d'un fichiercp exo.sh exo1.sh
datedate Affichage 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 directory Listing du contenu d'un répertoirels Formation
ls Formation/TP1
mkdirmkdir dirName Création un répertoire (directory)mkdir Formation/TP2
moremore fileName Lecture à l'écran de fichiers texte (surtout longs)more table.txt
mvmv inputFile targetFile Dé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 command + Donne 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 command Renvoie le chemin de la commande qui est exécutée quand on tape son nom dans le shellwhich ls
+
+
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/corrigeSed.fre.html b/UnixShell_cours2018/corrigeSed.fre.html new file mode 100644 index 0000000..c428b1f --- /dev/null +++ b/UnixShell_cours2018/corrigeSed.fre.html @@ -0,0 +1,108 @@ + + + + + + Corrigé du TP SED - UNIX + + + +

Corrigé du TP SED - UNIX

+ +

+ Utilisation simple +

+

Énoncé

+

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

+

Solution

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

+ Utilisation d'un fichier de commandes +

+

Énoncé

+

+ É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. +

+

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 +

+

Énoncé

+

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

+

Solution

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

+ On aurait pu aussi utiliser la commande cut. +

+ +

+ Substitution dans toute la ligne +

+

Énoncé

+

+ É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>>.). +

+

Solution

+
sed -e 's/"\([^"]*\)"/<<\1>>/g'
+ + +
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/corrigeShell.fre.html b/UnixShell_cours2018/corrigeShell.fre.html new file mode 100644 index 0000000..937c128 --- /dev/null +++ b/UnixShell_cours2018/corrigeShell.fre.html @@ -0,0 +1,618 @@ + + + + + + + Corrigé du TP - Shell - UNIX + + + +

Corrigé du TP - 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 shell 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. +

    + + Retour +
    # Fichier "infouser1.sh"
    +#!/bin/sh
    +grep $1 /etc/passwd
    +
    +
  2. +
  3. + +

    + Modifiez ce script 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. +

    + Retour +
    # Fichier "infouser2.sh"
    +#!/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. + +
  5. +

    + Modifiez encore ce shell pour qu'il teste si l'utilisateur + demandé existe sur votre machine. En cas d'absence, + affichez un message d'avertissement. +

    + + Retour +
    # Fichier "infouser3.sh"
    +#!/bin/sh
    +
    +if test $# -ne 1
    +then
    +	echo Mauvais nombre de parametres.
    +	echo
    +	echo Usage: $0 [uid]
    +	exit 1
    +fi
    +
    +if test `grep $1 /etc/passwd | wc -l` -lt 1
    +then
    +	echo L\'utilisateur $1 n\'est pas créé sur cette machine.
    +	exit 2
    +fi
    +
    +grep $1 /etc/passwd
    +

    + Par défaut, le shell s'arrête avec un statut à zéro, c'est + pourquoi une ligne exit 0 à la fin du programme + est superflue. +

    +

    + Le test effectué est -lt 1 (plus petit que 1), + mais on aurait tout aussi bien pu faire -eq 0. +

    +

    + Le texte de sortie contient des \', pour que le + shell n'interprète pas ce caractère spécial comme une quote, + mais comme une apostrophe (texte normal, et pas caractère + spécial). +

    +

    + On aurait pu aussi utiliser un test plus simple sur le + résultat de grep $1 /etc/passwd, et le + transformer en if test ! $?. +

    +
  6. +
+ +

+ Édition de statistiques sur un corpus XML +

+

+ Pour cette partie du TP, il vous faut d'abord récupérer + les deux corpus suivants :
+ corpus1.xml.gz
+ corpus2.xml.gz
+ Ces deux fichiers contiennent 25 notices en XML Dilib, leur exploration + préparatoire est conseillée. +

+ +
    +
  1. +

    + Écrivez un script shell qui édite le + pourcentage de résumés, pour chacun des deux + corpus, en passant le nom de fichier en + paramètre.
    + + Les fichiers ne devront + jamais être décompressés sur + disque.
    + + L'élément résumé se nomme + fC01. +

    + + Retour +
    # Fichier "resume1.sh"
    +#!/bin/sh
    +
    +if test $# -ne 1
    +then
    +	echo Mauvais nombre de parametres.
    +	echo
    +	echo Usage: $0 fichier
    +	exit 1
    +fi
    +
    +NB_LIGNES=`gzcat $1|wc -l`
    +NB_RESUMES=`gzcat $1|grep fC01|wc -l`
    +
    +NB_RES_100=`expr 100 \* $NB_RESUMES`
    +POURCENTAGE=`expr $NB_RES_100 / $NB_LIGNES`
    +
    +echo Pourcentage de notices avec résumé dans $1: ${POURCENTAGE}%
    +

    + N'oubliez pas de banaliser l'opérateur de multiplication, + sinon expr ne comprendra pas ce que vous + demandez (man expr pour plus de détails). +

    +

    + gzcat est utilisé, mais on pourrait aussi + utiliser gunzip -c. +

    +
    +
  2. +
  3. +

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

    + + Retour +
    # Fichier "resume2.sh"
    +#!/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_LIGNES=`gzcat $1|wc -l`
    +NB_RESUMES=`gzcat $1|grep fC01|wc -l`
    +
    +NB_RES_100=`expr 100 \* $NB_RESUMES`
    +POURCENTAGE=`expr $NB_RES_100 / $NB_LIGNES`
    +
    +echo Pourcentage de notices avec résumé dans $1: ${POURCENTAGE}% > resultatsfC01.txt
    +

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

    +
    +
  4. +
  5. +

    + Écrivez un script shell qui, pour les deux corpus et + en testant l'existence du fichier demandé, calcule le + pourcentage de notices sans résumé, le + pourcentage de notices de type périodique et le + pourcentage de notices de langue française.
    + + La liste des éléments à prendre en + compte sera passée en paramètres en ligne au + shell et ceux-ci seront traités en boucle avec un + while.
    + + Les statistiques obtenues seront + récupérées dans le fichier + resultatsMulti.txt.
    + + Les éléments à utiliser sont + fA60 pour le type de document (P + pour périodique) et fA23 pour la langue + (FRE pour la langue française). +

    + + Retour +
    # Fichier "resume3.sh"
    +#!/bin/sh
    +
    +if test $# -lt 1
    +then
    +	echo Mauvais nombre de parametres.
    +	echo
    +	echo Usage: $0 fichier...
    +	exit 1
    +fi
    +
    +rm -f resultatsMulti.txt
    +
    +while test $# -ne 0
    +do
    +	if test ! -f $1
    +	then
    +		echo $1 "n'existe pas (ou n'est pas un fichier)."
    +		exit 2
    +	fi
    +
    +	echo ----------- >> resultatsMulti.txt
    +	echo $1 >> resultatsMulti.txt
    +	echo ----------- >> resultatsMulti.txt
    +
    +	NB_LIGNES=`gzcat $1|wc -l`
    +	NB_SANS_RESUME=`gzcat $1|grep -v fC01|wc -l`
    +	NB_PERIODIQUES=`gzcat $1|grep "fA60><s1>P</"|wc -l`
    +	NB_FRANCAIS=`gzcat $1|grep "fA23 i1=\"01\"><s0>FRE</"|wc -l`
    +
    +	NB_SANS_RES_100=`expr 100 \* $NB_SANS_RESUME`
    +	POURCENTAGE_SANS_RES=`expr $NB_SANS_RES_100 / $NB_LIGNES`
    +
    +	echo "Pourcentage de notices sans résumé        : ${POURCENTAGE_SANS_RES}%" \
    +		 >> resultatsMulti.txt
    +
    +	NB_PERIO_100=`expr 100 \* $NB_PERIODIQUES`
    +	POURCENTAGE_PERIODIQUES=`expr $NB_PERIO_100 / $NB_LIGNES`
    +
    +	echo "Pourcentage de notices de type périodique : ${POURCENTAGE_PERIODIQUES}%" \
    +		>> resultatsMulti.txt
    +
    +	NB_FRANCAIS_100=`expr 100 \* $NB_FRANCAIS`
    +	POURCENTAGE_FRANCAIS=`expr $NB_FRANCAIS_100 / $NB_LIGNES`
    +
    +	echo "Pourcentage de notices françaises         : ${POURCENTAGE_FRANCAIS}%" \
    +		>> resultatsMulti.txt
    +
    +	shift
    +done
    +

    + shift est utilisé pour parcourir tous les + paramètres et considérer chacun d'entre eux comme le + paramètre numéro 1. +

    +

    + Le rm -f resultatsMulti.txt est là pour + éviter la concaténation des résultats avec ceux des + exécutions précédentes du même script. +

    +

    + Pour plus de précision, on pourrait utiliser la commande + DILIB SgmlSelect plutôt que + grep, pour sélectionner les notices + françaises (en effet, si l'attribut i1 changeait, la + commande de comptage deviendrait plus compliquée avec + grep). +

    +

    + Le caractère \ en fin de ligne permet de + passer à la ligne sans interrompre la commande. C'est une + facilité de présentation. +

    +

    + Retour +

    +
    +
  6. +
  7. +

    + Modifiez le shell précédent pour que le + fichier résultat soit compressé au choix + (Oui/Non). +

    + + Retour +
    # Fichier "resume4.sh"
    +#!/bin/sh
    +
    +if test $# -lt 1
    +then
    +	echo Mauvais nombre de parametres.
    +	echo
    +	echo Usage: $0 [-z] fichier...
    +	exit 1
    +fi
    +
    +rm -f resultatsMulti.txt*
    +
    +COMPRESSION=0
    +
    +while test $# -ne 0
    +do
    +	case $1 in
    +	-z )	COMPRESSION=1 ;;
    +	* )
    +		if test ! -f $1
    +		then
    +			echo $1 "n'existe pas (ou n'est pas un fichier)."
    +			exit 2
    +		fi
    +
    +		echo ----------- >> resultatsMulti.txt
    +		echo $1 >> resultatsMulti.txt
    +		echo ----------- >> resultatsMulti.txt
    +
    +		NB_LIGNES=`gzcat $1|wc -l`
    +		NB_SANS_RESUME=`gzcat $1|grep -v fC01|wc -l`
    +		NB_PERIODIQUES=`gzcat $1|grep "fA60><s1>P</"|wc -l`
    +		NB_FRANCAIS=`gzcat $1|grep "fA23 i1=\"01\"><s0>FRE</"|wc -l`
    +
    +		NB_SANS_RES_100=`expr 100 \* $NB_SANS_RESUME`
    +		POURCENTAGE_SANS_RES=`expr $NB_SANS_RES_100 / $NB_LIGNES`
    +
    +		echo "Pourcentage de notices sans résumé        : ${POURCENTAGE_SANS_RES}%" \
    +			>> resultatsMulti.txt
    +
    +		NB_PERIO_100=`expr 100 \* $NB_PERIODIQUES`
    +		POURCENTAGE_PERIODIQUES=`expr $NB_PERIO_100 / $NB_LIGNES`
    +
    +		echo "Pourcentage de notices de type périodique : ${POURCENTAGE_PERIODIQUES}%" \
    +			 >> resultatsMulti.txt
    +
    +		NB_FRANCAIS_100=`expr 100 \* $NB_FRANCAIS`
    +		POURCENTAGE_FRANCAIS=`expr $NB_FRANCAIS_100 / $NB_LIGNES`
    +
    +		echo "Pourcentage de notices françaises         : ${POURCENTAGE_FRANCAIS}%" \
    +			 >> resultatsMulti.txt
    +		;;
    +	esac
    +
    +	shift
    +done
    +
    +if test $COMPRESSION -eq 1
    +then
    +	touch resultatsMulti.txt
    +	gzip resultatsMulti.txt
    +fi
    +

    + L'utilisation du case à l'intérieur du + while autorise l'apparition de l'option + -z n'importe où sur la ligne de commande. +

    +

    + L'instruction touch resultatsMulti.txt + permet, lorsqu'aucun fichier n'a été passé en paramètre, + et que l'option -z a été sélectionnée, de ne + pas avoir de message d'erreur: resultatsMulti.txt: + No such file or directory. On ne peut pas + compresser un fichier qui n'existe pas. touch + modifie la date de dernière modification d'un fichier, + mais aussi elle crée un fichier lorsqu'il + n'existe pas. +

    +

    + Retour +

    +
    +
  8. +
  9. +

    + Reprenez le shell précédent pour que le + fichier résultat soit nommé avec une + indication de date/heure à l'aide de la commande + date d'Unix (notion de mise à + jour). + + ATTENTION ! On considèrera le fichier + corpus2.xml.gz comme une mise à jour de + corpus1.xml.gz. Leur différence de + nommage pourra par exemple être liée + plutôt à l'heure qu'à la date.--> +

    + + Retour +
    # Fichier "resume5.sh"
    +#!/bin/sh
    +
    +if test $# -lt 1
    +then
    +	echo Mauvais nombre de parametres.
    +	echo
    +	echo Usage: $0 [-z] fichier...
    +	exit 1
    +fi
    +
    +NOM_FICHIER=resultatsMulti`date '+%H%M%S'`.txt
    +
    +COMPRESSION=0
    +
    +while test $# -ne 0
    +do
    +	case $1 in
    +	-z )	COMPRESSION=1 ;;
    +	* )
    +		if test ! -f $1
    +		then
    +			echo $1 "n'existe pas (ou n'est pas un fichier)."
    +			exit 2
    +		fi
    +
    +		echo ----------- >> $NOM_FICHIER
    +		echo $1 >> $NOM_FICHIER
    +		echo ----------- >> $NOM_FICHIER
    +
    +		NB_LIGNES=`gzcat $1|wc -l`
    +		NB_SANS_RESUME=`gzcat $1|grep -v fC01|wc -l`
    +		NB_PERIODIQUES=`gzcat $1|grep "fA60><s1>P</"|wc -l`
    +		NB_FRANCAIS=`gzcat $1|grep "fA23 i1=\"01\"><s0>FRE</"|wc -l`
    +
    +		NB_SANS_RES_100=`expr 100 \* $NB_SANS_RESUME`
    +		POURCENTAGE_SANS_RES=`expr $NB_SANS_RES_100 / $NB_LIGNES`
    +
    +		echo "Pourcentage de notices sans résumé        : ${POURCENTAGE_SANS_RES}%" \
    +			>> $NOM_FICHIER
    +
    +		NB_PERIO_100=`expr 100 \* $NB_PERIODIQUES`
    +		POURCENTAGE_PERIODIQUES=`expr $NB_PERIO_100 / $NB_LIGNES`
    +
    +		echo "Pourcentage de notices de type périodique : ${POURCENTAGE_PERIODIQUES}%" \
    +			 >> $NOM_FICHIER
    +
    +		NB_FRANCAIS_100=`expr 100 \* $NB_FRANCAIS`
    +		POURCENTAGE_FRANCAIS=`expr $NB_FRANCAIS_100 / $NB_LIGNES`
    +
    +		echo "Pourcentage de notices françaises         : ${POURCENTAGE_FRANCAIS}%" \
    +			 >> $NOM_FICHIER
    +		;;
    +	esac
    +
    +	shift
    +done
    +
    +if test $COMPRESSION -eq 1
    +then
    +	touch $NOM_FICHIER
    +	gzip $NOM_FICHIER
    +fi
    +

    + Retour +

    +
    +
  10. +
  11. +

    + Écrivez un shell qui, reprenant les exercices + précédents, calcule les statistiques sur le + fichier corpus1.xml.gz, puis stocke les + résultats en compressé. Ensuite, le même + traitement sera porté sur corpus2.xml.gz + considéré comme une mise à jour + cumulative des statistiques (c'est-à-dire qu'il n'y + aura qu'un seul fichier résultat repris puis + écrasé au second traitement). +

    + + Retour +
    # Fichier "resume6.sh"
    +#!/bin/sh
    +
    +if test $# -lt 1
    +then
    +	echo Mauvais nombre de parametres.
    +	echo
    +	echo Usage: $0 [-z] fichier...
    +	exit 1
    +fi
    +
    +NOM_FICHIER=resultatsMulti`date '+%H%M%S'`.txt
    +
    +COMPRESSION=0
    +
    +CUMUL_NB_LIGNES=0
    +CUMUL_NB_SANS_RESUME=0
    +CUMUL_NB_PERIODIQUES=0
    +CUMUL_NB_FRANCAIS=0
    +
    +while test $# -ne 0
    +do
    +	case $1 in
    +	-z )	COMPRESSION=1 ;;
    +	* )
    +		if test ! -f $1
    +		then
    +			echo $1 "n'existe pas (ou n'est pas un fichier)."
    +			exit 2
    +		fi
    +
    +		echo ----------- >> $NOM_FICHIER
    +		echo $1 >> $NOM_FICHIER
    +		echo ----------- >> $NOM_FICHIER
    +
    +		NB_LIGNES=`gzcat $1|wc -l`
    +		NB_SANS_RESUME=`gzcat $1|grep -v fC01|wc -l`
    +		NB_PERIODIQUES=`gzcat $1|grep "fA60><s1>P</"|wc -l`
    +		NB_FRANCAIS=`gzcat $1|grep "fA23 i1=\"01\"><s0>FRE</"|wc -l`
    +
    +		CUMUL_NB_LIGNES=`expr $CUMUL_NB_LIGNES + $NB_LIGNES`
    +		CUMUL_NB_SANS_RESUME=`expr $CUMUL_NB_SANS_RESUME + $NB_SANS_RESUME`
    +		CUMUL_NB_PERIODIQUES=`expr $CUMUL_NB_PERIODIQUES + $NB_PERIODIQUES`
    +		CUMUL_NB_FRANCAIS=`expr $CUMUL_NB_FRANCAIS + $NB_FRANCAIS`
    +
    +		NB_SANS_RES_100=`expr 100 \* $NB_SANS_RESUME`
    +		POURCENTAGE_SANS_RES=`expr $NB_SANS_RES_100 / $NB_LIGNES`
    +
    +		echo "Pourcentage de notices sans résumé        : ${POURCENTAGE_SANS_RES}%" \
    +			>> $NOM_FICHIER
    +
    +		NB_PERIO_100=`expr 100 \* $NB_PERIODIQUES`
    +		POURCENTAGE_PERIODIQUES=`expr $NB_PERIO_100 / $NB_LIGNES`
    +
    +		echo "Pourcentage de notices de type périodique : ${POURCENTAGE_PERIODIQUES}%" \
    +			 >> $NOM_FICHIER
    +
    +		NB_FRANCAIS_100=`expr 100 \* $NB_FRANCAIS`
    +		POURCENTAGE_FRANCAIS=`expr $NB_FRANCAIS_100 / $NB_LIGNES`
    +
    +		echo "Pourcentage de notices françaises         : ${POURCENTAGE_FRANCAIS}%" \
    +			 >> $NOM_FICHIER
    +		;;
    +	esac
    +
    +	shift
    +done
    +
    +if test $CUMUL_NB_LIGNES -gt 0
    +then
    +	NB_SANS_RES_100=`expr 100 \* $CUMUL_NB_SANS_RESUME`
    +	POURCENTAGE_SANS_RES=`expr $NB_SANS_RES_100 / $CUMUL_NB_LIGNES`
    +
    +	NB_PERIO_100=`expr 100 \* $CUMUL_NB_PERIODIQUES`
    +	POURCENTAGE_PERIODIQUES=`expr $NB_PERIO_100 / $CUMUL_NB_LIGNES`
    +
    +	NB_FRANCAIS_100=`expr 100 \* $CUMUL_NB_FRANCAIS`
    +	POURCENTAGE_FRANCAIS=`expr $NB_FRANCAIS_100 / $CUMUL_NB_LIGNES`
    +
    +	echo --------------- CUMUL >> $NOM_FICHIER
    +	echo "Pourcentage de notices sans résumé        : ${POURCENTAGE_SANS_RES}%" \
    +		>> $NOM_FICHIER
    +	echo "Pourcentage de notices de type périodique : ${POURCENTAGE_PERIODIQUES}%" \
    +		 >> $NOM_FICHIER
    +	echo "Pourcentage de notices françaises         : ${POURCENTAGE_FRANCAIS}%" \
    +		 >> $NOM_FICHIER
    +fi
    +
    +if test $COMPRESSION -eq 1
    +then
    +	touch $NOM_FICHIER
    +	gzip $NOM_FICHIER
    +fi
    +

    + On teste le nombre de lignes cumulées, car dans le cas où + aucun fichier n'aurait été traité, la variable + CUMUL_NB_LIGNES vaudrait zéro, et + occasionnerait une erreur lors de la division! +

    +

    + Retour +

    +
    +
  12. +
+ +
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/corrigesNewCommands.fre.html b/UnixShell_cours2018/corrigesNewCommands.fre.html new file mode 100644 index 0000000..d3b3f47 --- /dev/null +++ b/UnixShell_cours2018/corrigesNewCommands.fre.html @@ -0,0 +1,579 @@ + + + + + + CORRIGÉS TRAVAUX PRATIQUES (Nouvelles commandes) - UNIX + + + + + +

CORRIGÉS TRAVAUX PRATIQUES
(Nouvelles commandes)

+ +

Commandes utilisateurs

+ + + +

Gestion des droits

+ + + +

Archivage et compression

+ + + +

Gestion des processus

+ + + +
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/corrigesRappels.fre.html b/UnixShell_cours2018/corrigesRappels.fre.html new file mode 100644 index 0000000..dbe2f92 --- /dev/null +++ b/UnixShell_cours2018/corrigesRappels.fre.html @@ -0,0 +1,171 @@ + + + + + + CORRIGÉS TRAVAUX PRATIQUES (Rappels) - UNIX + + + + + +

CORRIGÉS TRAVAUX PRATIQUES (Rappels)

+ +

+ La connexion doit être faite sur r2d2. Votre position + initiale est, par défaut, sur votre home + directory. +

+ +

Paramétrage de votre nouveau compte sur r2d2

+ + +

Préparation de votre environnement de travail

+ + + +

Utilisation de quelques commandes Unix de base

+ + + +
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/data_dc.tar.gz b/UnixShell_cours2018/data_dc.tar.gz new file mode 100644 index 0000000..5b4d77d --- /dev/null +++ b/UnixShell_cours2018/data_dc.tar.gz Binary files differ diff --git a/UnixShell_cours2018/francis.exodic.xml b/UnixShell_cours2018/francis.exodic.xml new file mode 100644 index 0000000..37955e4 --- /dev/null +++ b/UnixShell_cours2018/francis.exodic.xml @@ -0,0 +1,4408 @@ + + + <ttl type="main" lang="eng">Economy, politics and institutions: from adaptation to adaptive management in climate change</ttl> + + + + Joseph + ARVAI + Editor + Editeur scientifique + + + Tomas + KOONTZ + Editor + Editeur scientifique + + + Paul + ROBBINS + Editor + Editeur scientifique + + + Brent + SOHNGEN + Editor + Editeur scientifique + + + Alexander + THOMPSON + Editor + Editeur scientifique + + + Environmental Science and Policy Program, and Dept. of CARRS, Michigan State University + + + + + School of Natural Resources, Ohio State University + + + + + Department of Geography and Regional Development, University of Arizona + + + + + Department of Agricultural, Environmental, and Development Economics, Ohio State University + + + + + Department of Political Science, Ohio State University + + + + + Climate Change and Environmental Research Initiative (CCERI) + + + Organiser of meeting + Organisateur de congrès + + + Environmental Policy Initiative (EPI) + + + Organiser of meeting + Organisateur de congrès + + + Mershon Center + + + Organiser of meeting + Organisateur de congrès + + + Cluster for Interdisciplinary Research on International Themes (CIRIT) + + + Organiser of meeting + Organisateur de congrès + + + + + Sociologie environnementale + + + Ecologie sociale + + + Changement organisationnel + Organizational change + Cambio organizacional + + + Ecologie humaine + human ecology + Ecología humana + + + Politique environnement + Environmental policy + Política medio ambiente + + + Adaptabilité + Adaptability + Adaptabilidad + + + Adaptation + adaptation + Adaptación + + + Aspect social + Social aspect + Aspecto social + + + Aspect économique + Economic aspect + Aspecto económico + + + Impact environnement + environment impact + + + Réchauffement planétaire + global warming + + + Modification climat + climate modification + + + Changement planétaire + global change + Cambio planetario + + + Meteorology + Météorologie + + + Environment + Environnement + + + Geology + Géologie + + + Agriculture plant pathology + Agriculture, phytopathologie + + + Climatologie. Bioclimatologie. Changement climatique. + Climatology. Bioclimatology. Climate change. + + + Problèmes de l'environnement. + Environmental Problems. + + + ECOLOGIE HUMAINE ET DEMOGRAPHIE + HUMAN ECOLOGY AND DEMOGRAPHY + + + SOCIOLOGIE + SOCIOLOGY + + + + Springer + Dordrecht + + + + + + Conference on Adaptive Research and Governance in Climate Change + Columbus, OH + + + + + + + INIST-CNRS + 17218 + + + + Climatic change + Clim. change + + 2006 + 78 + 1 + + 226 + dissem. + + + + + + + Copyright 2006 INIST-CNRS. All rights reserved. + INIST + + + + + <ttl type="main" lang="eng">Human strategies for coping with El Niño related drought in Amazônia</ttl> + + + + Emilio F. + MORAN + + + Ryan + ADAMS + + + Bryn + BAKOYEMA + + + Stefano + FIORINI T + + + Bruce + BOUCEK + + + Anthropological Center for Training in Global Environmental Change (ACT), Indiana University + Bloomington + + + + + Center for the Study of Population, Institutions, and Environmental Change (CIPEC), Indiana University + Bloomington + + + + + Anthropology Department, Indiana University + Bloomington + + + + + Geography Department, Indiana University + Bloomington + + + + + + + Amérique du Sud + South America + America del sur + + + Variabilité climat + Climate variability + Variabilidad climática + + + Sociologie environnementale + + + Brésil + Brazil + Brasil + + + Amazonie + Amazonia + + + Ecologie humaine + human ecology + Ecología humana + + + Agrométéorologie + Agrometeorology + Agrometeorología + + + Prévision météorologique + Weather forecast + Previsión meteorológica + + + Adaptation + adaptation + Adaptación + + + Agriculteur + Farmer + Agricultor + + + Agriculture + agriculture + Agricultura + + + Vulnérabilité + vulnerability + + + Forêt ombrophile tropicale + Tropical rain forest + Bosque tropical húmedo + + + Incendie forêt + Forest fire + Incendio forestal + + + Sécheresse + drought + Sequedad + + + Précipitation atmosphérique + atmospheric precipitation + Precipitación atmosférica + + + El Nino + El Nino + + + Climatologie dynamique + Dynamical climatology + Climatología dinámica + + + Meteorology + Météorologie + + + Environment + Environnement + + + Geology + Géologie + + + Agriculture plant pathology + Agriculture, phytopathologie + + + Climatologie. Bioclimatologie. Changement climatique. + Climatology. Bioclimatology. Climate change. + + + Applications météorologiques. + Meteorological applications. + + + Problèmes de l'environnement. + Environmental Problems. + + + ECOLOGIE HUMAINE ET DEMOGRAPHIE + HUMAN ECOLOGY AND DEMOGRAPHY + + + SOCIOLOGIE + SOCIOLOGY + + + + This article reports on findings of a research project examining farmers' coping strategies in the Brazilian Amazon in response to El Niiio related weather events. We examine the extent of vulnerability of small and large farmers to these events in a tropical rainforest environment. Little attention has been given to the impact of ENSO events in Amazônia, despite evidence for devastating fires during ENSOs. Although we found a range of locally developed forecasting techniques and coping mechanisms; farmers have sustained significant losses, and we suggest that increased access to scientific forecasts would greatly enhance the ability of the farmers in our study area to cope with El Niño related weather events. In Amazônia the El Niiio phase of the El Niño-Southern Oscillation (ENSO) climate pattern leads to an extended period of reduced rainfall (Hobbs et al., 1998). This period of reduced rainfall can result in significant agricultural losses for farmers and ranchers in the area and in increased forest flammability. We have found that the majority of our study population uses several methods of forecasting, coping with, and adapting to drought events - and they recognize the economic losses they can experience and the loss of forests through the accidental spread of fire. The poorest farmers in our study area experience El Niiio related drought events as a serious threat to their livelihoods. Their vulnerability is heightened during extreme climate events and our observations revealed that all of the farmers in our study would benefit from increased availability of improved forecast information relevant to their locality and their current farming strategies. This paper examines the availability and use of forecasts, the occurrence of accidental fires and techniques to prevent fire related losses, and the coping mechanisms for dealing with El Niño related drought , in the agricultural regions surrounding the cities of Altamira and Santarém, in Pará State, Brazil. Distribution of an El Niño Prediction Kit at the end of the study and a series of workshops may lead to better local information on rainfall variability and create a farmer-maintained grid of collecting stations to sensitize farmers to the variability of precipitation in the region, and on their property. + + + Springer + Dordrecht + + + + + + + + INIST-CNRS + 17218 + + + + Climatic change + Clim. change + + 2006 + 77 + 3-4 + + + 343 + 361 + + 19 + 1 p.1/2 + + + + + + + Copyright 2006 INIST-CNRS. All rights reserved. + INIST + + + + + <ttl type="main" lang="eng">Learning to adapt : Organisational adaptation to climate change impacts</ttl> + + + <ttl type="main" lang="eng">Economy, politics and institutions: from adaptation to adaptive management in climate change</ttl> + + + + Frans + BERKHOUT + + + Julia + HERTIN + + + David M. + GANN + + + Joseph + ARVAI + Editor + Editeur scientifique + + + Tomas + KOONTZ + Editor + Editeur scientifique + + + Paul + ROBBINS + Editor + Editeur scientifique + + + Brent + SOHNGEN + Editor + Editeur scientifique + + + Alexander + THOMPSON + Editor + Editeur scientifique + + + Institute for Environmental Studies, Faculty of Earth and Life Sciences, Vrije Universiteit Amsterdam + + + + + SPRU-Science and Technology Policy Research, University of Sussex + + + + + Innovation Studies Centre, Tanaka Business School and Civil & Environmental Engineering, Imperial College London + + + + + Environmental Science and Policy Program, and Dept. of CARRS, Michigan State University + + + + + School of Natural Resources, Ohio State University + + + + + Department of Geography and Regional Development, University of Arizona + + + + + Department of Agricultural, Environmental, and Development Economics, Ohio State University + + + + + Department of Political Science, Ohio State University + + + + + Climate Change and Environmental Research Initiative (CCERI) + + + Organiser of meeting + Organisateur de congrès + + + Environmental Policy Initiative (EPI) + + + Organiser of meeting + Organisateur de congrès + + + Mershon Center + + + Organiser of meeting + Organisateur de congrès + + + Cluster for Interdisciplinary Research on International Themes (CIRIT) + + + Organiser of meeting + Organisateur de congrès + + + + + Sociologie environnementale + + + Protection environnement + environment protection + Protección medio ambiente + + + Ecologie humaine + human ecology + Ecología humana + + + Changement organisationnel + Organizational change + Cambio organizacional + + + Apprentissage + Learning + Aprendizaje + + + Entreprise + Firm + Empresa + + + Adaptation + adaptation + Adaptación + + + Vulnérabilité + vulnerability + + + Gestion risque + Risk management + Gestión riesgo + + + Réchauffement planétaire + global warming + + + Modification climat + climate modification + + + Changement planétaire + global change + Cambio planetario + + + Meteorology + Météorologie + + + Environment + Environnement + + + Geology + Géologie + + + Agriculture plant pathology + Agriculture, phytopathologie + + + Climatologie. Bioclimatologie. Changement climatique. + Climatology. Bioclimatology. Climate change. + + + Problèmes de l'environnement. + Environmental Problems. + + + ECOLOGIE HUMAINE ET DEMOGRAPHIE + HUMAN ECOLOGY AND DEMOGRAPHY + + + SOCIOLOGIE + SOCIOLOGY + + + + Analysis of human adaptation to climate change should be based on realistic models of adaptive behaviour at the level of organisations and individuals. The paper sets out a framework for analysing adaptation to the direct and indirect impacts of climate change in business organisations with new evidence presented from empirical research into adaptation in nine case-study companies. It argues that adaptation to climate change has many similarities with processes of organisational learning. The paper suggests that business organisations face a number of obstacles in learning how to adapt to climate change impacts, especially in relation to the weakness and ambiguity of signals about climate change and the uncertainty about benefits flowing from adaptation measures. Organisations rarely adapt 'autonomously', since their adaptive behaviour is influenced by policy and market conditions, and draws on resources external to the organisation. The paper identifies four adaptation strategies that pattern organisational adaptive behaviour. + + + Springer + Dordrecht + + + + + + Conference on Adaptive Research and Governance in Climate Change + Columbus, OH + + + + + + + INIST-CNRS + 17218 + + + + Climatic change + Clim. change + + 2006 + 78 + 1 + + + 135 + 156 + + 22 + 1 p.3/4 + + + + + + + Copyright 2006 INIST-CNRS. All rights reserved. + INIST + + + + + <ttl type="main" lang="eng">The generational divide in support for environmental policies : European evidence</ttl> + + + <ttl type="main" lang="eng">Global warming: The psychology of long-term risk</ttl> + + + + Joni + HERSCH + + + W. + KIP VISCUSI + + + Michael + OPPENHEIMER + Editor + Editeur scientifique + + + Alexander + TODOROV + Editor + Editeur scientifique + + + Adjunct Professor of Law, Harvard Law School + Cambridge, MA 02138 + + + + + Cogan Professor of Law & Economics, Harvard Law School + Cambridge, MA 02138 + + + + + Department of Geosciences and the Woodrow Wilson School, Princeton University + + + + + Department of Psychology and the Woodrow Wilson School, Princeton University + + + + + Cooperative Institute for Climate Science + + + Organiser of meeting + Organisateur de congrès + + + Princeton University'fs Woodrow Wilson School of Public and International Affairs. Program in Science, Technology, and Environmental Policy + + + Organiser of meeting + Organisateur de congrès + + + + + Sociologie environnementale + + + Ecologie sociale + + + Europe + Europe + Europa + + + Ecologie humaine + human ecology + Ecología humana + + + Lutte antipollution + Pollution control + Lucha anticontaminación + + + Essence + Gasoline + Gasolina + + + Taxation + Taxation + Tasación + + + Etude cas + case studies + Estudio caso + + + Effet génération + Generation effect + Efecto generación + + + Age + age + Edad + + + Enquête opinion + Opinion inquiry + Encuesta opinión + + + Opinion publique + Public opinion + Opinión pública + + + Perception sociale + Social perception + Percepción social + + + Attitude + Attitude + Actitud + + + Politique environnement + Environmental policy + Política medio ambiente + + + Protection environnement + environment protection + Protección medio ambiente + + + Réchauffement planétaire + global warming + + + Modification climat + climate modification + + + Changement planétaire + global change + Cambio planetario + + + Meteorology + Météorologie + + + Environment + Environnement + + + Geology + Géologie + + + Agriculture plant pathology + Agriculture, phytopathologie + + + Climatologie. Bioclimatologie. Changement climatique. + Climatology. Bioclimatology. Climate change. + + + Environnement. Ecologie. + Environment. Ecology. + + + Problèmes de l'environnement. + Environmental Problems. + + + ECOLOGIE HUMAINE ET DEMOGRAPHIE + HUMAN ECOLOGY AND DEMOGRAPHY + + + SOCIOLOGIE + SOCIOLOGY + + + + This article examines age variations in support for environmental protection policies that affect climate change using a sample of over 14,000 respondents to a 1999 Eurobarometer survey. There is a steady decline with age in whether respondents are willing to incur higher gasoline prices to protect the environment. This relationship remains after controlling for socioeconomic characteristics. There are age-related differences in information about environmental risks, information sources about the environment, perceived health risks from climate change, and degree of worry about climate change. However, taking these factors into account does not eliminate the age variation in willingness to pay more for gasoline to protect the environment. + + + Springer + Dordrecht + + + + + + Global warming: The psychology of long-term risk. Workshop + Princeton + + + + + + + INIST-CNRS + 17218 + + + + Climatic change + Clim. change + + 2006 + 77 + 1-2 + + + 121 + 136 + + 16 + 22 ref. + + + + + + + Copyright 2006 INIST-CNRS. All rights reserved. + INIST + + + + + <ttl type="main" lang="eng">Climate change as a predictable surprise</ttl> + + + <ttl type="main" lang="eng">Global warming: The psychology of long-term risk</ttl> + + + + Max H. + BAZERMAN + + + Michael + OPPENHEIMER + Editor + Editeur scientifique + + + Alexander + TODOROV + Editor + Editeur scientifique + + + Harvard University + + + + + Department of Geosciences and the Woodrow Wilson School, Princeton University + + + + + Department of Psychology and the Woodrow Wilson School, Princeton University + + + + + Cooperative Institute for Climate Science + + + Organiser of meeting + Organisateur de congrès + + + Princeton University'fs Woodrow Wilson School of Public and International Affairs. Program in Science, Technology, and Environmental Policy + + + Organiser of meeting + Organisateur de congrès + + + + + Perception du risque + Risk perception + Percepción del riesgo + + + Sociologie environnementale + + + Ecologie sociale + + + Ecologie humaine + human ecology + Ecología humana + + + Politique publique + Public policy + Politica pública + + + Politique environnement + Environmental policy + Política medio ambiente + + + Action politique + Political activity + Acción política + + + Echelon national + National scope + Escalón nacional + + + Analyse comportementale + Behavioral analysis + Análisis conductual + + + Adaptation + adaptation + Adaptación + + + Action préventive + preventive measures + Acción preventiva + + + Prise décision + decision making + + + Perception sociale + Social perception + Percepción social + + + Réchauffement planétaire + global warming + + + Modification climat + climate modification + + + Changement planétaire + global change + Cambio planetario + + + Meteorology + Météorologie + + + Environment + Environnement + + + Geology + Géologie + + + Agriculture plant pathology + Agriculture, phytopathologie + + + Climatologie. Bioclimatologie. Changement climatique. + Climatology. Bioclimatology. Climate change. + + + Environnement. Ecologie. + Environment. Ecology. + + + Problèmes de l'environnement. + Environmental Problems. + + + ECOLOGIE HUMAINE ET DEMOGRAPHIE + HUMAN ECOLOGY AND DEMOGRAPHY + + + SOCIOLOGIE + SOCIOLOGY + + + + In this article, I analyze climate change as a "predictable surprise," an event that leads an organization or nation to react with surprise, despite the fact that the information necessary to anticipate the event and its consequences was available (Bazerman and Watkins, 2004). I then assess the cognitive, organizational, and political reasons why society fails to implement wise strategies to prevent predictable surprises generally and climate change specifically. Finally, I conclude with an outline of a set of response strategies to overcome barriers to change. + + + Springer + Dordrecht + + + + + + Global warming: The psychology of long-term risk. Workshop + Princeton + + + + + + + INIST-CNRS + 17218 + + + + Climatic change + Clim. change + + 2006 + 77 + 1-2 + + + 179 + 193 + + 15 + 1 p.1/4 + + + + + + + Copyright 2006 INIST-CNRS. All rights reserved. + INIST + + + + + <ttl type="main" lang="eng">Climatic change, wars and dynastic cycles in China over the last millennium</ttl> + + + + David D. + ZHANG + + + C. Y. + JIM + + + George C.-S. + LIN + + + Yuan-Qing + HE + + + James J. + WANG + + + Harry F. + LEE + + + Department of Geography, University of Hong Kong, Pokfulam Road + + + + + CAREERI, Chinese Academy of Science + Lanzhou 730000, Gansu + + + + + + + Asie + Asia + Asia + + + Extrême Orient + Far East + Extremo Oriente + + + Phanérozoïque + Phanerozoic + Fanerozoico + + + Cénozoïque + Cenozoic + Cenozoico + + + Quaternaire + Quaternary + Cuaternario + + + Quaternaire sup + upper Quaternary + Cuaternario sup + + + Climatologie dynamique + Dynamical climatology + Climatología dinámica + + + Chine + China + China + + + Variabilité spatiale + Spatial variability + Variabilidad espacial + + + Relation homme environnement + Man environment interface + Relación hombre medio ambiente + + + Changement politique + Political change + Cambio político + + + Guerre + War + Guerra + + + Fréquence apparition + Occurrence frequency + Frecuencia aparición + + + Impact social + Social impact + Impacto social + + + Analyse corrélation + Correlation analysis + Análisis correlación + + + Paléotempérature + paleotemperature + Paleotemperatura + + + Modification climat + climate modification + + + Holocène + Holocene + Holoceno + + + Paléoclimat + paleoclimate + Paleoclima + + + Paléoclimatologie + paleoclimatology + + + Meteorology + Météorologie + + + Environment + Environnement + + + Geology + Géologie + + + Agriculture plant pathology + Agriculture, phytopathologie + + + Quaternaire marin et continental. + Marine and continental Quaternary. + + + Climatologie. Bioclimatologie. Changement climatique. + Climatology. Bioclimatology. Climate change. + + + Quaternaire marin et continental. + Marine and continental Quaternary. + + + Généralités. + Generalities + + + ASIE + Asia + + + ART ET ARCHEOLOGIE + ART AND ARCHAEOLOGY + + + + In recent years, the phenomenon of global warming and its implications for the future of the human race have been intensively studied. In contrast, few quantitative studies have been attempted on the notable effects of past climatic changes upon human societies. This study explored the relationship between climatic change and war in China by comparing high-resolution paleoclimatic reconstructions with known war incidences in China in the last millennium. War frequencies showed a cyclic pattern that closely followed the global paleo-temperature changes. Strong and significant correlations were found between climatic change, war occurrence, harvest level, population size and dynastic transition. During cold phases, China suffered more often from frequent wars, population decline and dynastic changes. The quantitative analyses suggested that the reduction of thermal energy input during a cold phase would lower the land carrying capacity in the traditional agrarian society, and the population size, with significant accretions accrued in the previous warm phase, could not be sustained by the shrinking resource base. The stressed human-nature relationship generated a 'push force', leading to more frequent wars between states, regions and tribes, which could lead to the collapse of dynasties and collapses of human population size. War frequencies varied according to geographical locations (North, Central and South China) due to spatial variations in the physical environment and hence differential response to climatic change. Moreover, war occurrences demonstrated an obvious time lag after an episode of temperature fall, and the three geographical regions experienced different length of time lags. This research also shows that human population increases and collapses were correlated with the climatic phases and the social instabilities that were induced by climate changes during the last millennium. The findings proposed a new interpretation of human-nature relationship in the past, with implications for the impacts of anomalous global warming on future human conflicts. + + + Springer + Dordrecht + + + + + + + + INIST-CNRS + 17218 + + + + Climatic change + Clim. change + + 2006 + 76 + 3-4 + + + 459 + 477 + + 19 + 2 p. + + + + + + + Copyright 2006 INIST-CNRS. All rights reserved. + INIST + + + + + <ttl type="main" lang="eng">Thinking about global warming</ttl> + + + <ttl type="main" lang="eng">Global warming: The psychology of long-term risk</ttl> + + + + Jonathan + BARON + + + Michael + OPPENHEIMER + Editor + Editeur scientifique + + + Alexander + TODOROV + Editor + Editeur scientifique + + + Department of Psychology, University of Pennsylvania, 3720 Walnut St + Philadelphia, PA 19104-6241 + + + + + Department of Geosciences and the Woodrow Wilson School, Princeton University + + + + + Department of Psychology and the Woodrow Wilson School, Princeton University + + + + + Cooperative Institute for Climate Science + + + Organiser of meeting + Organisateur de congrès + + + Princeton University'fs Woodrow Wilson School of Public and International Affairs. Program in Science, Technology, and Environmental Policy + + + Organiser of meeting + Organisateur de congrès + + + + + Perception du risque + Risk perception + Percepción del riesgo + + + Sociologie environnementale + + + Ecologie sociale + + + Ecologie humaine + human ecology + Ecología humana + + + Réduction pollution + Pollution abatement + + + Lutte antipollution + Pollution control + Lucha anticontaminación + + + Politique environnement + Environmental policy + Política medio ambiente + + + Attitude + Attitude + Actitud + + + Opinion publique + Public opinion + Opinión pública + + + Perception sociale + Social perception + Percepción social + + + Réchauffement planétaire + global warming + + + Modification climat + climate modification + + + Changement planétaire + global change + Cambio planetario + + + Meteorology + Météorologie + + + Environment + Environnement + + + Geology + Géologie + + + Agriculture plant pathology + Agriculture, phytopathologie + + + Climatologie. Bioclimatologie. Changement climatique. + Climatology. Bioclimatology. Climate change. + + + Environnement. Ecologie. + Environment. Ecology. + + + Problèmes de l'environnement. + Environmental Problems. + + + ECOLOGIE HUMAINE ET DEMOGRAPHIE + HUMAN ECOLOGY AND DEMOGRAPHY + + + SOCIOLOGIE + SOCIOLOGY + + + + Attitudes toward global warming are influenced by various heuristics, which may distort policy away from what is optimal for the well-being of people. These possible distortions, or biases, include: a focus on harms that we cause, as opposed to those that we can remedy more easily; a feeling that those who cause a problem should fix it; a desire to undo a problem rather than compensate for its presence; parochial concern with one's own group (nation); and neglect of risks that are not available. Although most of these biases tend to make us attend relatively too much to global warming, other biases, such as wishful thinking, cause us to attend too little. I discuss these possible effects and illustrate some of them with an experiment conducted on the World Wide Web. + + + Springer + Dordrecht + + + + + + Global warming: The psychology of long-term risk. Workshop + Princeton + + + + + + + INIST-CNRS + 17218 + + + + Climatic change + Clim. change + + 2006 + 77 + 1-2 + + + 137 + 150 + + 14 + 1 p.1/4 + + + + + + + Copyright 2006 INIST-CNRS. All rights reserved. + INIST + + + + + <ttl type="main" lang="eng">The origins and consequences of democratic citizens' policy agendas : A study of popular concern about global warming</ttl> + + + <ttl type="main" lang="eng">Global warming: The psychology of long-term risk</ttl> + + + + Jon A. + KROSNICK + + + Allyson L. + HOLBROOK + + + Laura + LOWE + + + Penny S. + VISSER + + + Michael + OPPENHEIMER + Editor + Editeur scientifique + + + Alexander + TODOROV + Editor + Editeur scientifique + + + Departments of Communication, Political Science, and Psychology, Stanford University 432 McClatchy Hall, 450 Serra Mall + Stanford, CA 94305 + + + + + Departments of Public Administration and Psychology, Survey Research Laboratory, MC336, University of Illinois at Chicago, 412 S Peoria St., Sixth Floor + Chicago, IL 60607 + + + + + NFO Ad: Impact, 44 Montgomery St., Suite 2090 + San Francisco, CA 94104 + + + + + Department of Psychology, University of Chicago, 5848 S. University Avenue + Chicago, IL 60637 + + + + + Department of Geosciences and the Woodrow Wilson School, Princeton University + + + + + Department of Psychology and the Woodrow Wilson School, Princeton University + + + + + Cooperative Institute for Climate Science + + + Organiser of meeting + Organisateur de congrès + + + Princeton University'fs Woodrow Wilson School of Public and International Affairs. Program in Science, Technology, and Environmental Policy + + + Organiser of meeting + Organisateur de congrès + + + + + Amérique du Nord + North America + America del norte + + + Système alerte + Warning system + + + Perception du risque + Risk perception + Percepción del riesgo + + + Ecologie sociale + + + Sociologie environnementale + + + Etats Unis + United States + Estados Unidos + + + Ecologie humaine + human ecology + Ecología humana + + + Politique environnement + Environmental policy + Política medio ambiente + + + Modélisation + Modeling + Modelización + + + Mass media + Mass media + Medios comunicación de masas + + + Expérience personnelle + Personal experience + Experiencia personal + + + Attitude + Attitude + Actitud + + + Opinion publique + Public opinion + Opinión pública + + + Perception sociale + Social perception + Percepción social + + + Réchauffement planétaire + global warming + + + Modification climat + climate modification + + + Changement planétaire + global change + Cambio planetario + + + Meteorology + Météorologie + + + Environment + Environnement + + + Geology + Géologie + + + Agriculture plant pathology + Agriculture, phytopathologie + + + Climatologie. Bioclimatologie. Changement climatique. + Climatology. Bioclimatology. Climate change. + + + Environnement. Ecologie. + Environment. Ecology. + + + Problèmes de l'environnement. + Environmental Problems. + + + ECOLOGIE HUMAINE ET DEMOGRAPHIE + HUMAN ECOLOGY AND DEMOGRAPHY + + + SOCIOLOGIE + SOCIOLOGY + + + + This article proposes and tests a model of the causes and consequences of Americans' judgments of the national seriousness of global warming. The model proposes that seriousness judgments about global warming are a function of beliefs about the existence of global warming, attitudes toward it, the certainty with which these beliefs and attitudes are held, and beliefs about human responsibility for causing global warming and people's ability to remedy it. The model also proposes that beliefs about whether global warming is a problem are a function of relevant personal experiences (with the weather) and messages from informants (in this case, scientists), that attitudes toward global warming are a function of particular perceived consequences of global warming, and that certainty about these attitudes and beliefs is a function of knowledge and prior thought. Data from two representative sample surveys offer support for all of these propositions, document effects of national seriousness judgments on support for ameliorative efforts generally and specific ameliorative policies, and thereby point to psychological mechanisms that may be responsible for institutional and elite impact on the public's assessments of national problem importance and on public policy preferences. + + + Springer + Dordrecht + + + + + + Global warming: The psychology of long-term risk. Workshop + Princeton + + + + + + + INIST-CNRS + 17218 + + + + Climatic change + Clim. change + + 2006 + 77 + 1-2 + + + 7 + 43 + + 37 + 4 p.1/4 + + + + + + + Copyright 2006 INIST-CNRS. All rights reserved. + INIST + + + + + <ttl type="main" lang="eng">The perception and valuation of the risks of climate change : A rational and behavioral blend</ttl> + + + <ttl type="main" lang="eng">Global warming: The psychology of long-term risk</ttl> + + + + W. + KIP VISCUSI + + + Richard J. + ZECKHAUSER + + + Michael + OPPENHEIMER + Editor + Editeur scientifique + + + Alexander + TODOROV + Editor + Editeur scientifique + + + Harvard Law School, 1575 Massachusetts Avenue + Cambridge, MA 02138 + + + + + Kennedy School of Government, Harvard University + Cambridge, MA 02138 + + + + + Department of Geosciences and the Woodrow Wilson School, Princeton University + + + + + Department of Psychology and the Woodrow Wilson School, Princeton University + + + + + Cooperative Institute for Climate Science + + + Organiser of meeting + Organisateur de congrès + + + Princeton University'fs Woodrow Wilson School of Public and International Affairs. Program in Science, Technology, and Environmental Policy + + + Organiser of meeting + Organisateur de congrès + + + + + Amérique du Nord + North America + America del norte + + + Perception du risque + Risk perception + Percepción del riesgo + + + Ecologie sociale + + + Sociologie environnementale + + + Etats Unis + United States + Estados Unidos + + + Analyse comportementale + Behavioral analysis + Análisis conductual + + + Rationnel irrationnel + Rational irrational + Racional irracional + + + Prise décision + decision making + + + Attitude + Attitude + Actitud + + + Protection environnement + environment protection + Protección medio ambiente + + + Politique environnement + Environmental policy + Política medio ambiente + + + Enquête opinion + Opinion inquiry + Encuesta opinión + + + Opinion publique + Public opinion + Opinión pública + + + Perception sociale + Social perception + Percepción social + + + Réchauffement planétaire + global warming + + + Ecologie humaine + human ecology + Ecología humana + + + Modification climat + climate modification + + + Changement planétaire + global change + Cambio planetario + + + Meteorology + Météorologie + + + Environment + Environnement + + + Geology + Géologie + + + Agriculture plant pathology + Agriculture, phytopathologie + + + Climatologie. Bioclimatologie. Changement climatique. + Climatology. Bioclimatology. Climate change. + + + Environnement. Ecologie. + Environment. Ecology. + + + Problèmes de l'environnement. + Environmental Problems. + + + ECOLOGIE HUMAINE ET DEMOGRAPHIE + HUMAN ECOLOGY AND DEMOGRAPHY + + + SOCIOLOGIE + SOCIOLOGY + + + + Over 250 respondents - graduate students in law and public policy - assessed the risks of climate change and valued climate-change mitigation policies. Many aspects of their behavior were consistent with rational behavior. For example, respondents successfully estimated distributions of temperature increases in Boston by 2100. The median value of best estimates was 1-3 degrees Fahrenheit. In addition, people with higher risk estimates, whether for temperature or related risks (e.g., hurricane intensities) offered more to avoid warming. Median willingness to pay (WTP) to avoid global warming was $0.50/gallon, and 3% of income. And important scope tests (e.g., respondents paid more for bigger accomplishments) were passed. However, significant behavioral propensities also emerged. For example, accessibility of neutral information on global warming boosted risk estimates. Warming projections correlated with estimates for unrelated risks, such as earthquakes and heart attacks. The implied WTP for avoidance was much greater when asked as a percent of income than as a gas tax, a percent thinking bias. Home team betting showed itself; individuals predicting a Bush victory predicted smaller temperature increases. In the climate-change arena, behavioral decision tendencies are like a fun-house mirror: They magnify some estimates and shrink others, but the contours of rational decision remain recognizable. + + + Springer + Dordrecht + + + + + + Global warming: The psychology of long-term risk. Workshop + Princeton + + + + + + + INIST-CNRS + 17218 + + + + Climatic change + Clim. change + + 2006 + 77 + 1-2 + + + 151 + 177 + + 27 + 1 p.1/4 + + + + + + + Copyright 2006 INIST-CNRS. All rights reserved. + INIST + + + + + <ttl type="main" lang="eng">Tree-ring reconstructed maize yield in Central Mexico: 1474-2001</ttl> + + + + Matthew D. + THERRELL + + + David W. + STAHLE + + + Jose + VILLANUEVA DIAZ + + + Eladio H. + CORNEJO OVIEDO + + + Malcolm K. + CLEAVELAND + + + Department of Geosciences, University of Arkansas + Fayetteville, Arkansas 72701 + + + + + Instituto Nacional de Investigaciones Forestales y Agropecurias (INIFAP), KM 6.5, Margen Derecha Canal Sacramento + Gomez Palacio, Durango 35140 + + + + + Departamento Forestal, Universidad Autonoma Agraria Antonio Narro Buenavista + Saltillo, Coahuila 25315 + + + + + + + Amérique + America + + + Angiospermae + Angiospermae + Angiospermae + + + Monocotyledones + Monocotyledones + Monocotyledones + + + Gramineae + Gramineae + Gramineae + + + Plante céréalière + Cereal crop + Planta cerealista + + + Spermatophyta + Spermatophyta + Spermatophyta + + + Gymnospermae + Gymnospermae + Gymnospermae + + + Coniferales + Coniferales + Coniferales + + + Reconstruction historique + Historical reconstruction + Reconstrucción histórico + + + Climatologie dynamique + Dynamical climatology + Climatología dinámica + + + Mexique + Mexico + + + Siècle 19eme + Century 19th + Siglo 19 + + + Siècle 18eme + Century 18th + Siglo 18 + + + Siècle 17eme + Century 17th + Siglo 17 + + + Siècle 16eme + Century 16th + Siglo 16 + + + Siècle 15eme + Century 15th + Siglo 15 + + + Siècle 20eme + Century 20th + Siglo 20 + + + Famine + Famine + + + Gel + gels + + + Sécheresse + Drought + + + Précipitation atmosphérique + atmospheric precipitation + Precipitación atmosférica + + + Rendement + Yield + Rendimiento + + + Zea mays + Zea mays + Zea mays + + + Production agricole + Agricultural production + Producción agrícola + + + Agriculture + Agriculture + + + Pseudotsuga menziesii + Pseudotsuga menziesii + Pseudotsuga menziesii + + + Dendrochronologie + Dendrochronology + + + Dendroclimatologie + Dendroclimatology + + + Paléoclimat + paleoclimate + Paleoclima + + + Variation climat + Climate variation + Variación clima + + + Meteorology + Météorologie + + + Environment + Environnement + + + Geology + Géologie + + + Agriculture plant pathology + Agriculture, phytopathologie + + + Climatologie. Bioclimatologie. Changement climatique. + Climatology. Bioclimatology. Climate change. + + + Economie agricole. + Agricultural economics. + + + Mexique et Amérique centrale. + Mexico and Central America + + + AMERIQUE ET REGIONS ARCTIQUES + AMERICA AND ARCTIC REGIONS + + + PREHISTOIRE ET PROTOHISTOIRE + PREHISTORY AND PROTOHISTORY + + + + Maize was domesticated more than 6,000 years ago in central Mexico, and remains a vital staple food and cultural symbol in Mesoamerica. Maize yield in the central highlands is strongly dependant on adequate rainfall early in the growing season (April-June) because late maturation of the crop may result in damage from autumn frost. Climate-induced crop failures with profound socioeconomic impacts have punctuated Mexican history. However, reliable records of maize harvest have not been available until very recently, and historical records of crop yield and price are discontinuous and can be difficult to interpret. We have developed a continuous, exactly dated, tree-ring reconstruction of maize yield variability in central Mexico from 1474 to 2001 that provides new insight into the history of climate and food availability in the heartland of the Mesoamerican cultural province. The reconstruction indicates that seven of the most severe agricultural crises in Mexican history occurred during decadal-scale episodes of reconstructed maize shortfalls. + + + Springer + Dordrecht + + + + + + + + INIST-CNRS + 17218 + + + + Climatic change + Clim. change + + 2006 + 74 + 4 + + + 493 + 504 + + 12 + 2 p.1/4 + + + + + + + Copyright 2006 INIST-CNRS. All rights reserved. + INIST + + + + + <ttl type="main" lang="eng">Efficient DNA extraction and amplification of samples from the archeological site of Pompei (Italy)</ttl> + + + <ttl type="main" lang="eng">Macromolecules in cultural heritage (Selected contributions from the Conference in Catania(Italy), November 9-11, 2005)</ttl> + + + + Giancarlo + RANALLI + + + Claudia + BELLI + + + Giuseppe + LUSTRATO + + + Antonia + MELOSCIA + + + Massimiliano + ORSINI + + + Francesca + Cappitelli + Editor + Editeur scientifique + + + Yvonne + Shashoua + Editor + Editeur scientifique + + + Espedito + Vassallo + Editor + Editeur scientifique + + + DISTAAM, University of Molise, Via de Sanctis + 86100 Campobasso + + + + + Istituto di Igiene Università Cattolica del Sacro Cuore + 00168 Roma + + + + + + + Europe + Europe + Europa + + + Pompei + + + Etude expérimentale + Experimental study + Estudio experimental + + + Etude comparative + Comparative study + Estudio comparativo + + + Morphologie + Morphology + Morfología + + + Réaction chaîne polymérase + Polymerase chain reaction + Reacción cadena polimerasa + + + RNA 16S + 16S-RNA + ARN 16S + + + Extraction solide liquide + Solid liquid extraction + Extracción sólido líquido + + + Bactérie + Bacteria + Bacteria + + + Communauté microbienne + Microbial community + Comunidad microbiana + + + Italie + Italy + Italia + + + Site archéologique + Archaeological sites + Emplazamiento arqueológico + + + Latérite + Laterite + Laterita + + + Polymers, paint and wood industries + Polymères, industries des peintures et bois + + + Polymers, paint and wood industries + Polymères, industries des peintures et bois + + + Divers. + Miscellaneous. + + + Biodétérioration. Bioencrassement. + Biodeterioration. Biofouling. + + + BIOTECHNOLOGIES. + BIOTECHNOLOGY. + + + Analyses physiques et chimiques. + Physical and chemical analysis + + + METHODOLOGIE ET ETUDES GENERALES + METHODOLOGY AND GENERAL STUDIES + + + PREHISTOIRE ET PROTOHISTOIRE + PREHISTORY AND PROTOHISTORY + + + + Due to their growth and metabolism, microorganisms can cause severe damage to Cultural Heritage, through mechanical and chemical processes. In this paper we used molecular approaches to study bacterial communities on samples from the archeological site of Pompei (Italy). In particular four DNA extraction methods without prior cultivation of the microflora were compared. In terms of efficiency, the DNA extraction method based on the Tri-Reagent<TM> kit gave the best results. All extraction protocols coupled with 16S rDNA fragments PCR amplification were satisfactory; but the best results were obtained by Klentaq DNA LA Polymerase; this enzyme can be considered an effective tool for amplification of DNA from Cultural Heritage and possibly other environmental samples. + + + Wiley-VCH + Allemagne + + + + + + Macromolecules in cultural heritage. Conference + + + + + + + INIST-CNRS + 4111 S + + + + Macromolecular symposia + Macromol. symp. + + 2006 + 238 + + + 98 + 104 + + 7 + 17 ref. + Notes bibliogr. Index + + + 1 + + + + + Copyright 2006 INIST-CNRS. All rights reserved. + INIST + + + + + <ttl type="main" lang="eng">Public views on climate change : European and USA perspectives</ttl> + + + <ttl type="main" lang="eng">Global warming: The psychology of long-term risk</ttl> + + + + Irene + LORENZONI + + + Nick F. + PIDGEON + + + Michael + OPPENHEIMER + Editor + Editeur scientifique + + + Alexander + TODOROV + Editor + Editeur scientifique + + + Centre for Environmental Risk and Tyndall Centre for Climate Change Research, Zuckerman Institute for Connective Environmental Research, School of Environmental Sciences, University of East Anglia + Norwich NR4 7TJ + + + + + Department of Geosciences and the Woodrow Wilson School, Princeton University + + + + + Department of Psychology and the Woodrow Wilson School, Princeton University + + + + + Cooperative Institute for Climate Science + + + Organiser of meeting + Organisateur de congrès + + + Princeton University'fs Woodrow Wilson School of Public and International Affairs. Program in Science, Technology, and Environmental Policy + + + Organiser of meeting + Organisateur de congrès + + + + + Amérique du Nord + North America + America del norte + + + Perception du risque + Risk perception + Percepción del riesgo + + + Processus social + + + Ecologie sociale + + + Sociologie environnementale + + + Europe + Europe + Europa + + + Etats Unis + United States + Estados Unidos + + + Ecologie humaine + human ecology + Ecología humana + + + Enquête opinion + Opinion inquiry + Encuesta opinión + + + Analyse factorielle + factor analysis + Análisis factorial + + + Attitude + Attitude + Actitud + + + Etude comparative + Comparative study + Estudio comparativo + + + Perception sociale + Social perception + Percepción social + + + Opinion publique + Public opinion + Opinión pública + + + Réchauffement planétaire + global warming + + + Modification climat + climate modification + + + Changement planétaire + global change + Cambio planetario + + + Meteorology + Météorologie + + + Environment + Environnement + + + Geology + Géologie + + + Agriculture plant pathology + Agriculture, phytopathologie + + + Climatologie. Bioclimatologie. Changement climatique. + Climatology. Bioclimatology. Climate change. + + + Environnement. Ecologie. + Environment. Ecology. + + + Problèmes de l'environnement. + Environmental Problems. + + + ECOLOGIE HUMAINE ET DEMOGRAPHIE + HUMAN ECOLOGY AND DEMOGRAPHY + + + SOCIOLOGIE + SOCIOLOGY + + + + If uncontrolled, human influences on the climate system may generate changes that will endanger various aspects of life on Earth. The precise implications of the scientific claims about climate change, and the extent to which they pose dangers to various populations, are becoming intensely debated at many levels in relation to policy. How 'danger' is interpreted will ultimately affect which actions are taken. In this paper, we examine how climate change is conceptualised by publics in Europe and in the USA. Although there is widespread concern about climate change, it is of secondary importance in comparison to other issues in people's daily lives. Most individuals relate to climate change through personal experience, knowledge, the balance of benefits and costs, and trust in other societal actors. We analyse these factors through findings from various surveys and studies, which highlight both the distinctiveness and some shared perspectives at a generalised level. We reflect upon these in relation to trust and responsibility for climate change action, and risk communication, supporting the call for discourses about climate change to also be situated in people's locality, as a means of increasing its saliency. + + + Springer + Dordrecht + + + + + + Global warming: The psychology of long-term risk. Workshop + Princeton + + + + + + + INIST-CNRS + 17218 + + + + Climatic change + Clim. change + + 2006 + 77 + 1-2 + + + 73 + 95 + + 23 + 2 p.1/4 + + + + + + + Copyright 2006 INIST-CNRS. All rights reserved. + INIST + + + + + <ttl type="main" lang="eng">Adaptive governance and climate change in the tropical highlands of Western South America</ttl> + + + <ttl type="main" lang="eng">Economy, politics and institutions: from adaptation to adaptive management in climate change</ttl> + + + + Kenneth R. + YOUNG + + + Jennifer K. + LIPTON + + + Joseph + ARVAI + Editor + Editeur scientifique + + + Tomas + KOONTZ + Editor + Editeur scientifique + + + Paul + ROBBINS + Editor + Editeur scientifique + + + Brent + SOHNGEN + Editor + Editeur scientifique + + + Alexander + THOMPSON + Editor + Editeur scientifique + + + Department of Geography and the Environment, University of Texas at Austin + Austin, TX 78712 + + + + + Environmental Science and Policy Program, and Dept. of CARRS, Michigan State University + + + + + School of Natural Resources, Ohio State University + + + + + Department of Geography and Regional Development, University of Arizona + + + + + Department of Agricultural, Environmental, and Development Economics, Ohio State University + + + + + Department of Political Science, Ohio State University + + + + + Climate Change and Environmental Research Initiative (CCERI) + + + Organiser of meeting + Organisateur de congrès + + + Environmental Policy Initiative (EPI) + + + Organiser of meeting + Organisateur de congrès + + + Mershon Center + + + Organiser of meeting + Organisateur de congrès + + + Cluster for Interdisciplinary Research on International Themes (CIRIT) + + + Organiser of meeting + Organisateur de congrès + + + + + Sociologie environnementale + + + Andes + Andes + Andes + + + Amérique du Sud + South America + America del sur + + + Ecologie humaine + human ecology + Ecología humana + + + Changement organisationnel + Organizational change + Cambio organizacional + + + Adaptabilité + Adaptability + Adaptabilidad + + + Adaptation + adaptation + Adaptación + + + Tiers Monde + Third World + + + Agriculture durable + Sustainable agriculture + Agricultura sostenible + + + Système culture + Cropping system + Sistema cultural + + + Agroécosystème + Agroecosystem + Agroecosistema + + + Occupation sol + land cover + + + Diversité espèce + species diversity + Diversidad especies + + + Ressource naturelle + natural resources + Recurso natural + + + Impact environnement + environment impact + + + Réchauffement planétaire + global warming + + + Modification climat + climate modification + + + Changement planétaire + global change + Cambio planetario + + + Meteorology + Météorologie + + + Environment + Environnement + + + Geology + Géologie + + + Agriculture plant pathology + Agriculture, phytopathologie + + + Climatologie. Bioclimatologie. Changement climatique. + Climatology. Bioclimatology. Climate change. + + + Agroécologie générale. + General agroecology. + + + Problèmes de l'environnement. + Environmental Problems. + + + ECOLOGIE HUMAINE ET DEMOGRAPHIE + HUMAN ECOLOGY AND DEMOGRAPHY + + + SOCIOLOGIE + SOCIOLOGY + + + + Climate changes occurring during the past several decades in the high elevations of the tropical Andes Mountains have implications for the native plant and animal species, for the ecological integrity of the affected land cover, and for the human-biophysical systems involved. Consequences are also probable for rural inhabitants and their livelihoods, especially for farmers and pastoralists. Biophysical factors have always changed in these mountainous zones; the extent and degree of alteration acting on native and agricultural biodiversity is the concern. Addressing these climate changes is probably within the adaptive capacity of many local land-use systems, unless external socioeconomic or political forces are unsupportive or antagonistic. Suitable programs to provide information, subsidies, or alternatives could be designed. We highlight some of the inherent resiliencies of natural and cultural systems in the Andes and suggest that these systems contain lessons that could be useful elsewhere, in terms of the traits that allow for the sustainable utilization of dynamic and heterogeneous landscapes. + + + Springer + Dordrecht + + + + + + Conference on Adaptive Research and Governance in Climate Change + Columbus, OH + + + + + + + INIST-CNRS + 17218 + + + + Climatic change + Clim. change + + 2006 + 78 + 1 + + + 63 + 102 + + 40 + 10 p.1/4 + + + + + + + Copyright 2006 INIST-CNRS. All rights reserved. + INIST + + + + + <ttl type="main" lang="fre">Dans l'oeil du cyclone</ttl> + <ttl type="translated" lang="eng">In the cyclonic eye</ttl> + + + + Laurence + EYMARD + + + + + Cyclone tropical + Tropical cyclone + Ciclón tropical + + + Cataclysme + Natural disaster + Cataclismo + + + Navigation maritime + Sea navigation + Navegación maritima + + + Climatologie + Climatology + Climatología + + + Océanographie + oceanography + Oceanografía + + + Siècle 18eme + Century 18th + Siglo 18 + + + Peinture ancienne + Ancient paint + Pintura antigua + + + Art + Art + Arte + + + Multidisciplinary + Multidisciplinaire + + + Divers. + Other topics in atmospheric geophysics. + + + Géophysique. Océanographie. Art de la navigation. + Geophysics. Oceanography. Navigation + + + SCIENCES ET TECHNIQUES DE LA TERRE + EARTH SCIENCES + + + HISTOIRE DES SCIENCES ET DES TECHNIQUES. + HISTORY OF SCIENCE AND TECHNOLOGY + + + + Pour la science + Paris + + + + + + + + INIST-CNRS + 18764 + + + + Pour la science + Pour sci. + + 2006 + 348 + + + 96 + 97 + + 2 + + + + + + + Copyright 2006 INIST-CNRS. All rights reserved. + INIST + + + + + <ttl type="main" lang="eng">Management under anarchy : The international politics of climate change</ttl> + + + <ttl type="main" lang="eng">Economy, politics and institutions: from adaptation to adaptive management in climate change</ttl> + + + + Alexander + THOMPSON + + + Joseph + ARVAI + Editor + Editeur scientifique + + + Tomas + KOONTZ + Editor + Editeur scientifique + + + Paul + ROBBINS + Editor + Editeur scientifique + + + Brent + SOHNGEN + Editor + Editeur scientifique + + + Alexander + THOMPSON + Editor + Editeur scientifique + + + Department of Political Science, Ohio State University, 2140 Derby Hall, 154 North Oval Mall + Columbus, OH 43210 + + + + + Environmental Science and Policy Program, and Dept. of CARRS, Michigan State University + + + + + School of Natural Resources, Ohio State University + + + + + Department of Geography and Regional Development, University of Arizona + + + + + Department of Agricultural, Environmental, and Development Economics, Ohio State University + + + + + Department of Political Science, Ohio State University + + + + + Climate Change and Environmental Research Initiative (CCERI) + + + Organiser of meeting + Organisateur de congrès + + + Environmental Policy Initiative (EPI) + + + Organiser of meeting + Organisateur de congrès + + + Mershon Center + + + Organiser of meeting + Organisateur de congrès + + + Cluster for Interdisciplinary Research on International Themes (CIRIT) + + + Organiser of meeting + Organisateur de congrès + + + + + Sociologie environnementale + + + Ecologie humaine + human ecology + Ecología humana + + + Efficacité + efficiency + + + Implémentation + Implementation + Implementación + + + Méthode adaptative + Adaptive method + Método adaptativo + + + Adaptation + adaptation + Adaptación + + + Coopération internationale + international cooperation + Cooperación internacional + + + Accord international + International agreements + + + Politique environnement + Environmental policy + Política medio ambiente + + + Gestion risque + Risk management + Gestión riesgo + + + Réchauffement planétaire + global warming + + + Modification climat + climate modification + + + Changement planétaire + global change + Cambio planetario + + + Meteorology + Météorologie + + + Environment + Environnement + + + Geology + Géologie + + + Agriculture plant pathology + Agriculture, phytopathologie + + + Climatologie. Bioclimatologie. Changement climatique. + Climatology. Bioclimatology. Climate change. + + + Pollution globale de l'environnement. + Global environmental pollution. + + + Problèmes de l'environnement. + Environmental Problems. + + + ECOLOGIE HUMAINE ET DEMOGRAPHIE + HUMAN ECOLOGY AND DEMOGRAPHY + + + SOCIOLOGIE + SOCIOLOGY + + + + This article analyzes climate change from the perspective of international politics. In the anarchy of the international system, various cooperation problems have stalled the formation of an effective climate regime at the international level. Obstacles occur at three stages of regime formation: the bargaining stage, the transition stage, and the implementation stage. The importance of the transition stage of cooperation, which takes place between the signing of an agreement and its entry into force, has been overlooked by international relations scholars and is particularly important in the climate case. The article assesses the possibility of applying 'adaptive management' principles to climate change as a partial response to these political obstacles. While such an approach has significant appeal given the uncertainty surrounding the human-climate interface, its experimental, top-down characteristics are not politically feasible at the international level. I recommend certain modifications of existing institutions and practices to improve international information sharing and facilitate efficient learning. These changes would serve to promote a decentralized and passive - and thus politically viable - version of adaptive management, an effective approach to dealing with climate change at the global level. + + + Springer + Dordrecht + + + + + + Conference on Adaptive Research and Governance in Climate Change + Columbus, OH + + + + + + + INIST-CNRS + 17218 + + + + Climatic change + Clim. change + + 2006 + 78 + 1 + + + 7 + 29 + + 23 + 2 p.1/4 + + + + + + + Copyright 2006 INIST-CNRS. All rights reserved. + INIST + + + + + <ttl type="main" lang="eng">Institutional adaptation of water resource infrastructures to climate change in Eastern Ontario</ttl> + + + <ttl type="main" lang="eng">Economy, politics and institutions: from adaptation to adaptive management in climate change</ttl> + + + + P. + CRABBE + + + M. + ROBIN + + + Joseph + ARVAI + Editor + Editeur scientifique + + + Tomas + KOONTZ + Editor + Editeur scientifique + + + Paul + ROBBINS + Editor + Editeur scientifique + + + Brent + SOHNGEN + Editor + Editeur scientifique + + + Alexander + THOMPSON + Editor + Editeur scientifique + + + Department of Economics, University of Ottawa, P.O. box 450, Stn A + Ottawa KIN 6N5 + + + + + Department of Earth Sciences, University of Ottawa, P.O. box 450, Stn A + Ottawa KIN 6N5 + + + + + Environmental Science and Policy Program, and Dept. of CARRS, Michigan State University + + + + + School of Natural Resources, Ohio State University + + + + + Department of Geography and Regional Development, University of Arizona + + + + + Department of Agricultural, Environmental, and Development Economics, Ohio State University + + + + + Department of Political Science, Ohio State University + + + + + Climate Change and Environmental Research Initiative (CCERI) + + + Organiser of meeting + Organisateur de congrès + + + Environmental Policy Initiative (EPI) + + + Organiser of meeting + Organisateur de congrès + + + Mershon Center + + + Organiser of meeting + Organisateur de congrès + + + Cluster for Interdisciplinary Research on International Themes (CIRIT) + + + Organiser of meeting + Organisateur de congrès + + + + + Amérique du Nord + North America + America del norte + + + Canada + Canada + Canada + + + Canada Est + Eastern Canada + Canadá Este + + + Sociologie environnementale + + + Ontario + Ontario + Ontario + + + Ecologie humaine + human ecology + Ecología humana + + + Changement organisationnel + Organizational change + Cambio organizacional + + + Politique environnement + Environmental policy + Política medio ambiente + + + Eau souterraine + ground water + Agua subterránea + + + Qualité eau + water quality + Calidad agua + + + Adaptabilité + Adaptability + Adaptabilidad + + + Participation communautaire + Community participation + Participación comunitaria + + + Echelon municipal + Municipal scope + Escalón municipal + + + Echelon local + Local scope + Escala local + + + Adaptation + adaptation + Adaptación + + + Infrastructure + Infrastructure + Infraestructura + + + Gestion ressource eau + water resource management + Gestión recurso agua + + + Etude cas + case studies + Estudio caso + + + Impact environnement + environment impact + + + Réchauffement planétaire + global warming + + + Modification climat + climate modification + + + Changement planétaire + global change + Cambio planetario + + + Meteorology + Météorologie + + + Environment + Environnement + + + Geology + Géologie + + + Agriculture plant pathology + Agriculture, phytopathologie + + + Climatologie. Bioclimatologie. Changement climatique. + Climatology. Bioclimatology. Climate change. + + + Ressources en eau. + Water resources. + + + Ressources en eau. + Water resources. + + + Problèmes de l'environnement. + Environmental Problems. + + + ECOLOGIE HUMAINE ET DEMOGRAPHIE + HUMAN ECOLOGY AND DEMOGRAPHY + + + SOCIOLOGIE + SOCIOLOGY + + + + Institutional barriers and bridges to local climate change impacts adaptation affecting small rural municipalities and Conservation Authorities (CAs are watershed agencies) in Eastern Ontario (Canada) are examined, and elements of a community-based adaptation strategy related to water infrastructures are proposed as a case-study in community adaptation to climate change. No general water scarcity is expected for the region even under unusually dry weather scenarios. Localized quantity and quality problems are likely to occur especially in groundwater recharge areas. Some existing institutions can be relied on by municipalities to build an effective adaptation strategy based on a watershed/region perspective, on their credibility, and on their expertise. Windows of opportunity or framing issues are offered at the provincial level, the most relevant one in a federal state, by municipal emergency plan requirements and pending watershed source water protection legislation. Voluntary and soon to be mandated climate change mitigation programs at the federal level are other ones. + + + Springer + Dordrecht + + + + + + Conference on Adaptive Research and Governance in Climate Change + Columbus, OH + + + + + + + INIST-CNRS + 17218 + + + + Climatic change + Clim. change + + 2006 + 78 + 1 + + + 103 + 133 + + 31 + 2 p. + + + + + + + Copyright 2006 INIST-CNRS. All rights reserved. + INIST + + + + + <ttl type="main" lang="fre">La dynamique des couleurs, des images et des sons (l'ingénieur et l'art, deuxième symposium international)</ttl> + + + + Ecole Nationale Supérieure des Arts et Métiers + Aix en Provence + + + Organiser of meeting + Organisateur de congrès + + + + + Peinture + Painting + + + Oeuvre art + Cultural artefact + Obra arte + + + Son musical + Musical sound + Sonido musical + + + Traitement signal acoustique + Acoustic signal processing + + + Vision couleur + Color vision + Vision color + + + Rendu couleur + Color rendering + Fatiga color + + + Analyse image + Image analysis + Análisis imagen + + + Traitement signal + Signal processing + Procesamiento señal + + + Traitement image + Image processing + Procesamiento imagen + + + Telecommunications + Télécommunications + + + Divers. + Miscellaneous. + + + Analyse du document, informatique et mathématiques. + Document analysis, computing, mathematics + + + GENERALITES + GENERALITIES + + + ART ET ARCHEOLOGIE + ART AND ARCHAEOLOGY + + + + ENSAM + Aix en Provence + + + + + + L' ingénieur et l'art. Symposium international + 2 + Aix en Provence + + + + + + + INIST-CNRS + Y 38371 + + + + 163 + Illustration + Illustration + Notes bibliogr + + + 1 + + + + + Copyright 2006 INIST-CNRS. All rights reserved. + INIST + + + + + <ttl type="main" lang="eng">From the micro-to the macro- : Managing the conservation of the warship, Vasa</ttl> + + + <ttl type="main" lang="eng">Macromolecules in cultural heritage (Selected contributions from the Conference in Catania(Italy), November 9-11, 2005)</ttl> + + + + Emma + HOCKER + + + Francesca + Cappitelli + Editor + Editeur scientifique + + + Yvonne + Shashoua + Editor + Editeur scientifique + + + Espedito + Vassallo + Editor + Editeur scientifique + + + The Vasa Museum, National Maritime Museums of Sweden + Stockholm + + + + + + + Europe + Europe + Europa + + + Siècle 17 + + + Conservation + Conservation + Conservación + + + Dépôt sel + Salt deposits + + + Formation dépôt + Deposit formation + Formación depósito + + + Ethylène oxyde polymère + Ethylene oxide polymer + Etileno óxido polímero + + + Bois ancien + Ancient wood + Madera antigua + + + Bois amélioré + Modified wood + Madera mejorada + + + Suède + Sweden + Suecia + + + Patrimoine historique + Historical heritage + Patrimonio histórico + + + Navire guerre + Warship + Buque guerra + + + Polymers, paint and wood industries + Polymères, industries des peintures et bois + + + Polymers, paint and wood industries + Polymères, industries des peintures et bois + + + Dégradation et protection. + Degradation and preservation. + + + Conservation. + Conservation + + + METHODOLOGIE ET ETUDES GENERALES + METHODOLOGY AND GENERAL STUDIES + + + PREHISTOIRE ET PROTOHISTOIRE + PREHISTORY AND PROTOHISTORY + + + + Sweden's famous warship, Vasa, sank on her maiden voyage in August 1628, and remained on the bottom of Stockholm harbour for 333 years. Raised in 1961, she became the first large-scale wooden object to be treated with polyethylene glycol (PEG). In the summer of 2000 a number of acidic salt precipitations were noticed on the surface of the ship and on wooden artefacts in the storerooms. An international research project has been established to look into the causes of this problem and suggest possible re-treatments. Meanwhile projects are underway to monitor movements in the ship, to build a better support system, and to replace the thousands of iron bolts holding the structure together, while a sophisticated new climate system has recently been installed in the museum. + + + Wiley-VCH + Allemagne + + + + + + Macromolecules in cultural heritage. Conference + + + + + + + INIST-CNRS + 4111 S + + + + Macromolecular symposia + Macromol. symp. + + 2006 + 238 + + + 16 + 21 + + 6 + 10 ref. + Notes bibliogr. Index + + + 1 + + + + + Copyright 2006 INIST-CNRS. All rights reserved. + INIST + + + + + <ttl type="main" lang="eng">Soil resources of the ancient maya at Piedras Negras, Guatemala</ttl> + + + + Fabian G. + FERNA'NDEZ + + + Kristofer D. + JOHNSON + + + Richard E. + TERRY + + + Sheldon + NELSON + + + David + WEBSTER + + + Dep. of Plant and Animal Sciences, Brigham Young Univ + Provo, UT 84602 + + + + + Dep. of Archaeology, Penn sylvania State Univ + State College, PA 16802 + + + + + + + Amérique Latine + Latin America + America latina + + + Forêt tropicale + Tropical forest + Bosque tropical + + + Relation homme environnement + Man environment interface + Relación hombre medio ambiente + + + Epoque préhistorique + Prehistory + Epoca prehistórica + + + Archéologie + Archaeology + + + Anthropologie + Anthropology + + + Pédologie + Pedology + + + Science terre + Earth science + Ciencia tierra + + + Science du sol + Soil science + Ciencia del suelo + + + Sol + soils + Suelo + + + Spermatophyta + Spermatophyta + Spermatophyta + + + Angiospermae + Angiospermae + Angiospermae + + + Monocotyledones + Monocotyledones + Monocotyledones + + + Gramineae + Gramineae + Gramineae + + + Plantae + Plantae + + + Spermatophyta + Spermatophyta + Spermatophyta + + + Angiospermae + angiosperms + Angiospermae + + + Monocotyledoneae + Monocotyledoneae + + + Terre agricole + Farmland + Tierra agrícola + + + Période précolombienne + Pre-columbian period + + + Epoque précolombienne + Precolumbian period + Época precolombina + + + Mayas + Mayas + Mayas + + + Carbone 13 + + + Sol forestier + forest soils + + + Forêt ombrophile tropicale + Tropical rain forest + Bosque tropical húmedo + + + Matière organique + + + Carbone Isotope + + + Zea mays + Zea mays + Zea mays + + + Gramineae + Gramineae + Gramineae + + + Plante céréalière + Cereal crop + Planta cerealista + + + Type C4 + + + Type C3 + + + Relation sol plante + + + Occupation sol + land cover + + + Erosion sol + + + Déboisement + + + Composition isotopique + + + Reconnaissance sol + + + Mollisol + + + Sol tropical + Tropical soil + Suelo tropical + + + Sol cultivé + Cultivated soil + Suelo cultivado + + + Site archéologique + Archaeological site + + + Guatemala + Guatemala + + + Propriété physique + + + Propriété chimique + + + Pédogenèse + + + Caractéristique sol + + + Ressource naturelle + natural resources + Recurso natural + + + Ressource agricole + Agricultural resources + Recurso agrícola + + + Activité humaine + Human activity + Actividad humana + + + Culture tropicale + Tropical crop + Cultivo tropical + + + Agriculture traditionnelle + Traditional farming + Agricultura tradicional + + + Agriculture plant pathology + Agriculture, phytopathologie + + + Geology + Géologie + + + Sols. + Soils. + + + Inventaire et classification des sols. Cartographie. + Soil surveys, classification and mapping. + + + Pédogenèse. + Soil genesis. + + + Sols. + Soils. + + + Mayas. + Mayas + + + CIVILISATIONS AMERICAINES + American civilisations + + + ART ET ARCHEOLOGIE + ART AND ARCHAEOLOGY + + + + The ancient Maya thrived for centuries in the Petén rain forest of Guatemala. Their impressive architecture and the evidence of highly populated centers attest that the Maya farmers were capable of producing food surpluses. In the eighth to ninth centuries CE the Classic Maya civilization collapsed. The processes leading to its decline are still debated, but unsustainable agricultural practices and exhaustion of natural resources may have contributed. This paper reports on soil formation rates, soil taxonomy, phytolith analysis, and δ13C values of soil organic matter in a rural area near the ancient city of Piedras Negras. Our objective was to understand ancient Maya rural life by linking soil characteristics to ancient agricultural resources and anthropogenic activites. We found that these soils formed at a rate of approximately 0.09 mm yr-1. All 15 soil profiles belonged to the order Mollisols. The soils of the back-slope locations were shallow (<25 cm) and were probably severely eroded at the time of abandonment (ninth century CE). The soils located at the valley's floor were deep, well developed, and potentially good for sustainable agriculture. Phytolith analysis indicated that in ancient times panacoid grasses were dominant in these soils and provided evidence that the forest was cleared for maize (Zea mays L.) agriculture. Stable C isotopes provided evidence that the vegetation shifted from forest (C3) to C4 vegetation during the time of Maya occupation. The toe-slope soils were observed to be less enriched in 13C in profiles closer to Piedras Negras than in those farther away. + + + Soil Science Society of America + Madison, WI + + + + + + + + INIST-CNRS + 6109 + + + + Soil Science Society of America journal + Soil Sci. Soc. Am. j. + + 2005 + 69 + 6 + + + 2020 + 2032 + + 13 + 1 p.3/4 + + + + + + + Copyright 2006 INIST-CNRS. All rights reserved. + INIST + + + + + <ttl type="main" lang="fre">La science au service de l'art : Transcription automatique de musique ancienne</ttl> + + + <ttl type="main" lang="fre">La dynamique des couleurs, des images et des sons (l'ingénieur et l'art, deuxième symposium international)</ttl> + + + + Michel + WALLET + + + Laboratoire d'Informatique, Université Blaise PASCAL + + + + + Equipe ERATTO, CNRS, IVRY/Seine Institut Universitaire de Technologie, BP 408 + 03107 Montlucon + + + + + Ecole Nationale Supérieure des Arts et Métiers + Aix en Provence + + + Organiser of meeting + Organisateur de congrès + + + + + Musique ancienne + + + Traitement signal acoustique + Acoustic signal processing + + + Instrument musique + Musical instrument + Instrumento musical + + + Son musical + Musical sound + Sonido musical + + + Traitement signal audio + Audio signal processing + + + Transcription automatique + Automatic transcription + Transcripción automática + + + Traitement signal + Signal processing + Procesamiento señal + + + Telecommunications + Télécommunications + + + Divers. + Miscellaneous. + + + Analyse du document, informatique et mathématiques. + Document analysis, computing, mathematics + + + GENERALITES + GENERALITIES + + + ART ET ARCHEOLOGIE + ART AND ARCHAEOLOGY + + + + Science at the service of art : automatic transcription of ancient music + + + ENSAM + Aix en Provence + + + + + + L' ingénieur et l'art. Symposium international + 2 + Aix en Provence + + + + + + + INIST-CNRS + Y 38371 + + + + + 105 + 110 + + 6 + Notes bibliogr + + + 1 + + + + + Copyright 2006 INIST-CNRS. All rights reserved. + INIST + + diff --git a/UnixShell_cours2018/historique.fre.html b/UnixShell_cours2018/historique.fre.html new file mode 100644 index 0000000..4240ad1 --- /dev/null +++ b/UnixShell_cours2018/historique.fre.html @@ -0,0 +1,148 @@ + + + + + Historique d'UNIX + + + + + + + + + +

Historique d'UNIX

+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
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

+ +
+

Référence

+ +
+
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/index.fre.html b/UnixShell_cours2018/index.fre.html new file mode 100644 index 0000000..9c898dc --- /dev/null +++ b/UnixShell_cours2018/index.fre.html @@ -0,0 +1,116 @@ + + + + + + Shell - UNIX + + + + + +

Tutoriel UNIX / Shell

+ + +
+

+ Ce tutoriel UNIX est principalement destiné à 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. +

+

+ La partie UNIX + porte sur une présentation des caractéristiques, + de l'historique d'Unix et du cas particulier de Linux. +

+

+ Dans les + Bases, + on parle rapidement des redirections et des + commandes de base à connaître. +

+

+ La partie + Commandes + présente des commandes Unix utiles. +

+

+ La partie Shell est une initiation pour la + programmation de scripts shell. +

+

+ Dans la partie sed, + on présente ensuite la substitution de textes de + l'éditeur de chaînes de caractères non + interactif. +

+

+ Dans make, + on présente un outil qui permet de faire gagner du temps, + en ne réitérant pas des calculs qui ne sont plus + nécessaires. +

+ +
+
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/linux.fre.html b/UnixShell_cours2018/linux.fre.html new file mode 100644 index 0000000..94dd5dd --- /dev/null +++ b/UnixShell_cours2018/linux.fre.html @@ -0,0 +1,73 @@ + + + + + Le cas de Linux + + + + + + + + + +

Le cas de 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

+ +
+
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/listeCles.txt b/UnixShell_cours2018/listeCles.txt new file mode 100644 index 0000000..9967db8 --- /dev/null +++ b/UnixShell_cours2018/listeCles.txt @@ -0,0 +1,4 @@ +10.1007 +10.1098 +10.1148 +BF02478894 diff --git a/UnixShell_cours2018/listeDOI.txt.gz b/UnixShell_cours2018/listeDOI.txt.gz new file mode 100644 index 0000000..dbac64e --- /dev/null +++ b/UnixShell_cours2018/listeDOI.txt.gz Binary files differ diff --git a/UnixShell_cours2018/make.fre.html b/UnixShell_cours2018/make.fre.html new file mode 100644 index 0000000..a773613 --- /dev/null +++ b/UnixShell_cours2018/make.fre.html @@ -0,0 +1,103 @@ + + + + + + Make + + + + + + + + + +

Make

+ + + +
+

+ make < GNU make (INIST -> GNU make) +

+ + + + Un shell fait tous les traitements qui y sont indiqués +
+ 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
+

+ Attention : 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

+ +
+ +
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/makefile b/UnixShell_cours2018/makefile new file mode 100644 index 0000000..e76ced8 --- /dev/null +++ b/UnixShell_cours2018/makefile @@ -0,0 +1,47 @@ +# -*- makefile -*- +# $Id: makefile,v 1.3 2003/07/02 12:53:32 parmentf Exp $ +# Corrig� du TP sur make. + +# la r�gle "all" d�pend du fichier compte.txt et des +# r�gles bonjour, clean et bye. +# le "@" devant "echo" rend la commande "silencieuse", elle n'appara�t +# pas sur la sortie standard. +all: bonjour compte.txt clean bye + @echo --- Make all: ex�cut� --- + +# en tapant "make clean", on supprime les fichiers finissant par ~ ou +# .o +clean: + rm -f *~ *.o + @echo ---- Make clean: ex�cut� --- + +# en tapant "make bonjour", on obtient le message suivant +bonjour: + @echo "Bonjour, comment �a va?" + @echo ---- Make bonjour: ex�cut� --- + +# idem avec "make bye" +bye: + @echo "� bient�t!" + @echo ---- Make bye: ex�cut� --- + +# le fichier modif.txt d�pend du contenu du fichier original.txt +modif.txt: original.txt + sed -e 's/ILIB/DILIB/g' < original.txt > modif.txt + @echo ---- Make modif.txt: ex�cut� --- + +# le fichier modif2.txt d�pend des contenus des fichiers original.txt +# et table.sed (si l'un des deux est modifi�, la commande sed sera +# ex�cut�e). +modif2.txt: original.txt table.sed + sed -f table.sed < original.txt > modif2.txt + @echo ---- Make modif2.txt: ex�cut� --- + +# le fichier compte.txt d�pend du fichier modif2.txt (donc de sa +# r�gle, qui d�pend de original.txt et de table.sed). Donc si on +# modifie table.sed et qu'on tape "make compte.txt", ou toute autre +# r�gle qui d�pend directement ou indirectement de table.sed, +# cette r�gle sera ex�cut�e. +compte.txt: modif2.txt + wc -l < modif2.txt > compte.txt + @echo ---- Make compte.txt: ex�cut� --- diff --git a/UnixShell_cours2018/makefile.fre.html b/UnixShell_cours2018/makefile.fre.html new file mode 100644 index 0000000..d3af303 --- /dev/null +++ b/UnixShell_cours2018/makefile.fre.html @@ -0,0 +1,145 @@ + + + + + + + Corrigé du TP make + + + +

Corrigé du TP make

+ + +

Énoncé

+

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

+

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. +

+
+ +

Énoncé

+

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

+

Solution

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

+ Le caractère précédent l'action est une + tabulation. Pour cette raison, vous ne pouvez copier-coller + à partir du HTML. Préférez le + téléchargement du fichier du corrigé. +

+
+ +

Énoncé

+

+ 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. +

+

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 :. +

+
+ +

Énoncé

+

+ 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. +

+

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). +

+
+ +

Énoncé

+

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

+

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. +

+
+ +

Énoncé

+

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

+

Solution

+
clean:
+	rm -f *~
+
+ +

Énoncé

+

+ 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é --). +

+

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é. +

+
+ +

+ Voir le fichier makefile complet. +

+

+ Le copier-coller à partir du navigateur est insuffisant (les + tabulations sont transformées en espaces), il faut donc utiliser + le clic droit et sauvegarder le fichier en local. +

+
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/newCommandsUser.fre.html b/UnixShell_cours2018/newCommandsUser.fre.html new file mode 100644 index 0000000..bd2bb0a --- /dev/null +++ b/UnixShell_cours2018/newCommandsUser.fre.html @@ -0,0 +1,366 @@ + + + + + + Nouvelles commandes - UNIX + + + + + + + + + + + +

Autres commandes Unix

+ + + +
+

Manuels en ligne

+ + + +
+

Commandes sur les fichiers

+ + + +
+

Commandes sur les contenus

+ + +
+ +
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/original.txt b/UnixShell_cours2018/original.txt new file mode 100644 index 0000000..3f3b1e2 --- /dev/null +++ b/UnixShell_cours2018/original.txt @@ -0,0 +1,6 @@ + ---- + ILIB + ---- + +O� l'on devrait parler d'ILIB! +ILIB a �t� �labor� � l'INIST (CNRS). diff --git a/UnixShell_cours2018/paramShell.fre.html b/UnixShell_cours2018/paramShell.fre.html new file mode 100644 index 0000000..0da17da --- /dev/null +++ b/UnixShell_cours2018/paramShell.fre.html @@ -0,0 +1,151 @@ + + + + + + + Paramètres - Shell - UNIX + + + + + + + + + +

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
+
+
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/pathsUnix.fre.html b/UnixShell_cours2018/pathsUnix.fre.html new file mode 100644 index 0000000..4caf922 --- /dev/null +++ b/UnixShell_cours2018/pathsUnix.fre.html @@ -0,0 +1,52 @@ + + + + + Chemins relatif et absolu - UNIX + + + + + +

Chemins (paths)

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
videRépertoire courantls
absoluCommence par le caractère /
Défini à partir de la racine
ls /users/dupont/public_html
relatif, en descendant
à partir du répertoire courant
Commence par un nom de répertoirels Server
relatif, en remontant
à partir du répertoire courant
Commence par .., répertoire parentls ../public_html
+ +

+ Comme nous le verrons par la suite, une variable d'environnement + contenant un chemin unix peut être inclue dans un chemin + absolu ou relatif.
Par exemple : ls $DILIB +

+ +
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/processesCommands.fre.html b/UnixShell_cours2018/processesCommands.fre.html new file mode 100644 index 0000000..a5c0789 --- /dev/null +++ b/UnixShell_cours2018/processesCommands.fre.html @@ -0,0 +1,162 @@ + + + + + Nouvelles commandes : Gestion des processus - UNIX + + + + + + + + + + +

Autres commandes Unix

+ + + + +
+

Gestion des processus

+ + +
+
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/redirPipes.fre.html b/UnixShell_cours2018/redirPipes.fre.html new file mode 100644 index 0000000..2216971 --- /dev/null +++ b/UnixShell_cours2018/redirPipes.fre.html @@ -0,0 +1,195 @@ + + + + + Redirections et Pipes - UNIX + + + + + + + + + + +

Redirections et Pipes

+ + + +
+

Redirections

+ +

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

+
+ 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 +
+

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

+ + + +
+

Redirection de la sortie standard vers un fichier

+ +

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

+ + +
+ +
+

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

+ +
+ 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.

+
+ +
+
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/rightsCommands.fre.html b/UnixShell_cours2018/rightsCommands.fre.html new file mode 100644 index 0000000..d24cfba --- /dev/null +++ b/UnixShell_cours2018/rightsCommands.fre.html @@ -0,0 +1,239 @@ + + + + + + Nouvelles commandes : + Gestion des droits + - UNIX + + + + + + + + + + +

Autres commandes Unix

+ + + +
+

Gestion des droits

+ + +
+
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/screenshot_gnome.jpg b/UnixShell_cours2018/screenshot_gnome.jpg new file mode 100644 index 0000000..b7081ea --- /dev/null +++ b/UnixShell_cours2018/screenshot_gnome.jpg Binary files differ diff --git a/UnixShell_cours2018/screenshot_kde.jpg b/UnixShell_cours2018/screenshot_kde.jpg new file mode 100644 index 0000000..054e94d --- /dev/null +++ b/UnixShell_cours2018/screenshot_kde.jpg Binary files differ diff --git a/UnixShell_cours2018/screenshot_xfce.jpg b/UnixShell_cours2018/screenshot_xfce.jpg new file mode 100644 index 0000000..a863760 --- /dev/null +++ b/UnixShell_cours2018/screenshot_xfce.jpg Binary files differ diff --git a/UnixShell_cours2018/sed.fre.html b/UnixShell_cours2018/sed.fre.html new file mode 100644 index 0000000..f765e7a --- /dev/null +++ b/UnixShell_cours2018/sed.fre.html @@ -0,0 +1,257 @@ + + + + + + + sed - UNIX + + + + + + + + + +

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ée. +

+

+ 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
+

Expression 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 +

+ +
+
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/shellScript.fre.html b/UnixShell_cours2018/shellScript.fre.html new file mode 100644 index 0000000..a93a87f --- /dev/null +++ b/UnixShell_cours2018/shellScript.fre.html @@ -0,0 +1,92 @@ + + + + + + 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é : +

+ +

+ 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. +

+
+
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/shellVars.fre.html b/UnixShell_cours2018/shellVars.fre.html new file mode 100644 index 0000000..9bc69c4 --- /dev/null +++ b/UnixShell_cours2018/shellVars.fre.html @@ -0,0 +1,130 @@ + + + + + + + Variables d'environnement - Shell - UNIX + + + + + + + + + +

Variables d'environnement - Shell - UNIX

+ + + +
+

Variables d'environnement

+ +

+ Le shell contient diverses variables d'environnement. Si vous + voulez les voir toutes, utilisez la commande set + 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"
PATH + liste 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
+

+ 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}
+

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

+

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

+
+
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/sommaire.fre.html b/UnixShell_cours2018/sommaire.fre.html new file mode 100644 index 0000000..ac8ace9 --- /dev/null +++ b/UnixShell_cours2018/sommaire.fre.html @@ -0,0 +1,75 @@ + + + + + + + sommaire - Shell - UNIX + + + + +

Sommaire

+ + +
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/structureShell.fre.html b/UnixShell_cours2018/structureShell.fre.html new file mode 100644 index 0000000..0d5d10a --- /dev/null +++ b/UnixShell_cours2018/structureShell.fre.html @@ -0,0 +1,149 @@ + + + + + + + Structures de contrôle - Shell - UNIX + + + + + + + + + +

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 + ($*). +

+

+ Exemple +

+
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
+ +
+
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/table.sed b/UnixShell_cours2018/table.sed new file mode 100644 index 0000000..d6f55f8 --- /dev/null +++ b/UnixShell_cours2018/table.sed @@ -0,0 +1,2 @@ +s/ILIB/DILIB/g +s/d'DILIB/de DILIB/g diff --git a/UnixShell_cours2018/table.txt b/UnixShell_cours2018/table.txt new file mode 100644 index 0000000..d6f55f8 --- /dev/null +++ b/UnixShell_cours2018/table.txt @@ -0,0 +1,2 @@ +s/ILIB/DILIB/g +s/d'DILIB/de DILIB/g diff --git a/UnixShell_cours2018/tarzipCommands.fre.html b/UnixShell_cours2018/tarzipCommands.fre.html new file mode 100644 index 0000000..860dcd9 --- /dev/null +++ b/UnixShell_cours2018/tarzipCommands.fre.html @@ -0,0 +1,177 @@ + + + + + + Nouvelles commandes : archives et (de)compression - UNIX + + + + + + + + + + +

Autres commandes Unix

+ + + +
+

Archives, compression, décompression

+ + +
+
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/testDiff1.txt b/UnixShell_cours2018/testDiff1.txt new file mode 100644 index 0000000..b761404 --- /dev/null +++ b/UnixShell_cours2018/testDiff1.txt @@ -0,0 +1,9 @@ +Fichier pour tester la commande diff d'Unix. +-------------------- +Ajoutez une ligne juste en dessous : +-------------------- +Supprimez la ligne qui suit : +LIGNE A SUPPRIMER +-------------------- +Modifiez comme vous le d�sirez la ligne suivante : +Modifiez-moi !!! diff --git a/UnixShell_cours2018/testShell.fre.html b/UnixShell_cours2018/testShell.fre.html new file mode 100644 index 0000000..12932c0 --- /dev/null +++ b/UnixShell_cours2018/testShell.fre.html @@ -0,0 +1,205 @@ + + + + + + + Tests - Shell - UNIX + + + + + + + + + +

Tests - 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 ou 1). 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
+ +
+
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/testUmask.txt b/UnixShell_cours2018/testUmask.txt new file mode 100644 index 0000000..e4590b0 --- /dev/null +++ b/UnixShell_cours2018/testUmask.txt @@ -0,0 +1 @@ +Pour tester votre umask. diff --git a/UnixShell_cours2018/tpMake.fre.html b/UnixShell_cours2018/tpMake.fre.html new file mode 100644 index 0000000..b76c3ed --- /dev/null +++ b/UnixShell_cours2018/tpMake.fre.html @@ -0,0 +1,254 @@ + + + + + + TRAVAUX PRATIQUES (partie make) - UNIX + + + + + + + + + + + + +

TRAVAUX PRATIQUES

+ + + +
+

Make

+ +

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

+ +
+ Cacher 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!. +

+ +
+ Cacher 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. +

+ +
+ Cacher 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. +

+ +
+ Cacher 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. +

+ +
+ Cacher 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 ~. +

+ +
+ Cacher 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 :

+ + +
+ Cacher 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. +

+
+
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/tpNewCommands.fre.html b/UnixShell_cours2018/tpNewCommands.fre.html new file mode 100644 index 0000000..4b12345 --- /dev/null +++ b/UnixShell_cours2018/tpNewCommands.fre.html @@ -0,0 +1,519 @@ + + + + + + Travaux Pratiques (Nouvelles commandes) - UNIX + + + + + + + + + + + + +

Travaux Pratiques
(Autres commandes Unix)

+ + + +
+

+ Cette seconde série de travaux pratiques se + décompose en 4 parties : commandes utilisateurs, gestion + des droits, archivage et décompression, gestion des + processus.

+ +

Commandes utilisateurs

+ + + +

Gestion des droits

+ + + +

Archivage et compression

+ + + +
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/tpRappels.fre.html b/UnixShell_cours2018/tpRappels.fre.html new file mode 100644 index 0000000..29764fa --- /dev/null +++ b/UnixShell_cours2018/tpRappels.fre.html @@ -0,0 +1,279 @@ + + + + + + Travaux Pratiques + (Rappels) + - UNIX + + + + + + + + + + + + +

Travaux Pratiques + (Bases)

+ + + +
+

+ 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

+ +
    +
  • + Créez les répertoires + Formation et Formation/UnixShell sous votre home + directory (avec contrôle du contenu des + répertoires à chaque étape avec ls ou + ll qui est un alias). + + +
    + Cacher la solution + + + + +
    + mkdir Formation
    + ls
    + ... Formation ...
    + mkdir Formation/UnixShell
    + ls Formation
    + ... UnixShell ... +
    +
    + +
  • +
  • + Déplacez-vous dans le répertoire + UnixShell en une étape et vérifiez le répertoire courant. + + +
    + Cacher la solution + + + + +
    + cd Formation/UnixShell
    + pwd
    + / ... /Formation/UnixShell +
    +
    + +
  • +
+ +

Utilisation de quelques commandes Unix de base

+ +
    +
  • + Visualisez l'historique de votre session, avec affichage en sortie standard. + + +
    + Cacher la solution + + + + +
    + history
    + ...
    + 1 mkdir Formation
    + 2 ls
    + 3 mkdir Formation/UnixShell
    + ...
    +
    +
    + +
  • +
  • + Récupérez votre historique dans un fichier + historique.txt. + + +
    + Cacher la solution + + +
    history > historique.txt
    +
    + +
  • +
  • + Affichez à l'écran le contenu de ce fichier + historique.txt. + + +
    + Cacher la solution + + +
    more historique.txt
    +
    + +
  • +
  • + Comptez le nombre de lignes de ce fichier. + + +
    + Cacher la solution + + + + +
    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 + + + + +
    • +
    • + avec un pipe pour enchaîner les deux commandes + appropriées + + +
      + Cacher la solution + + +
      cat historique.txt | head -3
      +
      + +
    • +
    +
  • +
  • + Renommez le fichier historique.txt en + monHistorique.txt + + +
    + Cacher la solution + + +
    mv historique.txt monHistorique.txt
    +
    + +
  • +
+
+
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/tpSed.fre.html b/UnixShell_cours2018/tpSed.fre.html new file mode 100644 index 0000000..7dcd044 --- /dev/null +++ b/UnixShell_cours2018/tpSed.fre.html @@ -0,0 +1,179 @@ + + + + + + + + + TP sed - UNIX + + + + + + + + + +

TP sed - UNIX

+ + + +
+

+ Utilisation simple +

+

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

+ +
+ Cacher 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. +

+ +
+ Cacher 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 :. +

+ +
+ Cacher 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>>.). +

+ +
+ Cacher la solution +
sed -e 's/"\([^"]*\)"/<<\1>>/g'
+
+
+
+
Philippe.Houdry@inist.fr
+ + diff --git a/UnixShell_cours2018/tpShell.fre.html b/UnixShell_cours2018/tpShell.fre.html new file mode 100644 index 0000000..8310f8b --- /dev/null +++ b/UnixShell_cours2018/tpShell.fre.html @@ -0,0 +1,303 @@ + + + + + + + + + TP shell - UNIX + + + + + + + + + +

TP 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. +

    + + +
    + Cacher 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. +

    + +
    + Cacher 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. +

    + +
    + Cacher 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. +

    + +
    + Cacher 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. +
    + +

    + +
    + Cacher 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. +

    + É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. +

    + +
    + Cacher 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). +

    + +
  7. +
+ +
+
Philippe.Houdry@inist.fr
+ +