Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext...

20
Unix Unix Raymond Ripp

Transcript of Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext...

Page 1: Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext transfer protocol X-windows Windows Protocoles - Langages.

UnixUnix

Raymond Ripp

Page 2: Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext transfer protocol X-windows Windows Protocoles - Langages.

ApplicationsApplications

En direct Navigateur Courier Mode console FenêtrageHTTP

Hypertext transfer protocol

X-windowsWindows

Protocoles - Langages de programmationProtocoles - Langages de programmation

Windows DirectX

WindowsMax OSLinux serveur

PHPJavaTclC

HTMLJavascriptX

SMTPSimple mail

transfer protocol

SSHSecure shell

Page 3: Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext transfer protocol X-windows Windows Protocoles - Langages.

Windows - Linux Windows - Linux Disques - ProcesseursDisques - Processeurs

WindowsMac OSLinux

titus

star6

sshssh

ssh

/home

/genomics

IGBMC

WindowsMac OSLinux

ssh

Page 4: Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext transfer protocol X-windows Windows Protocoles - Langages.

SSH sur star8SSH sur star8

mon_pc_> ssh –l ripp –X titus.u-strasbg.fr titus_ripp_> ssh –l ripp –X star8 star8_ripp_> pwd/groupes/poch/ripp star8_ripp_> cd CoursUnix star8_CoursUnix_> lsMonPremierScript.tcsh star8_CoursTcl_> MonPremierScript.tcsh

Page 5: Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext transfer protocol X-windows Windows Protocoles - Langages.

Les commandes élémentairesLes commandes élémentaires

cd /home/ripp pwd ls cat /home/ripp/www/fifi.txt more ./www/fifi.txt rm ./www/fifi.txt mkdir /home/ripp/CoursUlp rmdir CoursUlp

Page 6: Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext transfer protocol X-windows Windows Protocoles - Langages.

...élémentaires toujours,...élémentaires toujours,

mv fifi.txt CoursUlp/toto.txt cp /home/depulp1/p.tcl prog.tcl cd CoursUlp cd .. chmod 755 fichier rwx r-x r-x chmod 644 fichier rw- r-- r-- chmod 640 fichier rw- r-- ---

Page 7: Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext transfer protocol X-windows Windows Protocoles - Langages.

...élémentaires encore ?...élémentaires encore ?

alias llt ls -rt setgscope man commande apropos truc

date logout

Page 8: Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext transfer protocol X-windows Windows Protocoles - Langages.

Une commande, c'est ...Une commande, c'est ...

ls commande UNIX

xplor fichier exécutable (compilation, link)

settex alias

sauvetout shell script

/home/ripp/p.exe avec chemin d'accès explicite

rehash shell built-in command

Page 9: Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext transfer protocol X-windows Windows Protocoles - Langages.

C'est toujours et uniquement...C'est toujours et uniquement...

un alias taper alias pour les connaitre tous

une Built-In Command du shell utilisé

un fichier qui se trouve dans le path

which commandecommande aliased to quelquechose

commande : shell built-in command

/usr/bin/commande

Page 10: Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext transfer protocol X-windows Windows Protocoles - Langages.

Un fichier exécutableUn fichier exécutable Fichier de commandes (shell script)

Ou fichier binaire obtenu par compilation et link– Fortran, C, C++ ... ou fichier système

on le reconnait par– son extension (.tcl, .csh, .pl, …)– file fichier coeff alpha executable binay

Page 11: Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext transfer protocol X-windows Windows Protocoles - Langages.

Un Un shell scriptshell script

sh, ksh, csh, tcsh, tclsh, perl, ............................................. shell que j'aime: tcsh

c'est un fichier texte contenant

.................................. des commandes la première ligne contient le nom du shell

#!/bin/tcsh................. qui est le programme qui interprète vos commandes

Page 12: Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext transfer protocol X-windows Windows Protocoles - Langages.

... le ... le shell scriptshell script

on y met des commandes on l'exécute en tapant le nom du fichier

– ça crée un sous-process qui exécute

– /etc/csh.cshrc

– ~/.cshrc

– les commandes du fichier

qui oublie tout avant de revenir au process

ou alors (pour les nuls) : source fichier

Page 13: Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext transfer protocol X-windows Windows Protocoles - Langages.

Le Le pathpath, quand on tape

une commande on exécute

un fichier qui se trouve

sur un disque dans un répertoire cité dans

le pathpath

Page 14: Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext transfer protocol X-windows Windows Protocoles - Langages.

le le path,path,

est un ensemble de répertoires– qui contient les fichiers exécutables

est prédefiniecho $path

est modifié par certaines commandessetmolscript

peut être modifié par set path=dir $path addpath dir (rr)

Page 15: Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext transfer protocol X-windows Windows Protocoles - Langages.

le le path.path.

si vous voulez qu'un fichier /bidule/chose/fifi

devienne une commande fifi

trois solutions– addpath /bidule/chose– cp /bidule/chose/fifi /home/bin/fifi

– ln -s /bidule/chose/fifi /home/ripp/bin/fifi

Page 16: Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext transfer protocol X-windows Windows Protocoles - Langages.

Les plaisirs du lienLes plaisirs du lien

ln -s fichier lien ln -s /home/ripp/moyenne /bin/moy

c'est comme si /home/ripp/moyenne était copié

on fait vraiment comme si /bin/moy existait ls -l /bin/moy (lrwx--... /bin/moy -> /home/ripp/moyenne)

rm /bin/moy (/home/ripp/moyenne reste)

rm /home/ripp/moyenne (le lien, seul, reste)

Page 17: Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext transfer protocol X-windows Windows Protocoles - Langages.

Input Output Pipeline 1/3Input Output Pipeline 1/3

Un programme « sympa »– lit des données en entrée ( input = stdin)– calcule– écrit les résultats en sortie ( output = stout)– signale les erreurs ( error = stderr)

xplor < fichin > fichout

Page 18: Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext transfer protocol X-windows Windows Protocoles - Langages.

Input Output Pipeline 2/3Input Output Pipeline 2/3

Si on ne met pas < ou >– l’entrée standart est le clavier– la sortie standart est l’écran– la sortie erreur est aussi l’écran (>2 ou >&)

… mais si on veut que :

la sortie de l’un est l’entrée de l’autre ?

Page 19: Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext transfer protocol X-windows Windows Protocoles - Langages.

Input Output Pipeline 3/3Input Output Pipeline 3/3

progA < fichin | progB progA | progB | progC > fichou

Attention tous les programmes n’acceptent pas ce mécanisme stdin stdout

Ne pas confondre

entrée standart (avec <) et arguments

Page 20: Unix Raymond Ripp. Applications En directNavigateurCourierMode consoleFenêtrage HTTP Hypertext transfer protocol X-windows Windows Protocoles - Langages.

... des questions?

... plus de question?

... merci !