diff --git a/2_boucle_for_sortie b/2_boucle_for_sortie new file mode 100644 index 0000000..e7aeea3 --- /dev/null +++ b/2_boucle_for_sortie @@ -0,0 +1,10 @@ +acpi est un dossier +adduser.conf est un fichier +aliases est un fichier +aliases.db est un fichier +alsa est un dossier +alternatives est un dossier +anacrontab est un fichier +apm est un dossier +apparmor est un dossier +apparmor.d est un dossier diff --git a/2_while.sh b/2_while.sh old mode 100644 new mode 100755 index 7a693aa..4b5677e --- a/2_while.sh +++ b/2_while.sh @@ -1,3 +1,22 @@ #!/bin/bash +fichier="/etc/services" +while read ligne +do + if [ ! -z "$ligne" ] && [[ ! "$ligne" =~ ^#.* ]] + then + # Pour afficher la ligne seule + # echo $ligne + port=$(echo "$ligne" | cut -f3) + soft=$(echo "$ligne" | cut -f1) + if [ ! -z "$port" ] + then + #Pour afficher le port seul + #echo "Port $port" + + #Affichage port + nom du logiciel + echo "Port / nom prog. : $port $soft" + fi + fi +done < $fichier diff --git a/2_while_retour b/2_while_retour new file mode 100644 index 0000000..d355697 --- /dev/null +++ b/2_while_retour @@ -0,0 +1,10 @@ +Port / nom prog. : 1/tcp tcpmux +Port / nom prog. : 7/tcp echo +Port / nom prog. : 7/udp echo +Port / nom prog. : 9/tcp discard +Port / nom prog. : 9/udp discard +Port / nom prog. : 11/tcp systat +Port / nom prog. : 13/tcp daytime +Port / nom prog. : 13/udp daytime +Port / nom prog. : 15/tcp netstat +Port / nom prog. : 17/tcp qotd diff --git a/monshell2.sh b/monshell2.sh index 64b3086..9e41983 100755 --- a/monshell2.sh +++ b/monshell2.sh @@ -1,6 +1,6 @@ #!/bin/bash -read -p "entrez une valeur mavar" mavar +read -p "entrez une valeur mavar: " mavar if [ $mavar -eq 1 ] then diff --git a/monshell2_sortie b/monshell2_sortie new file mode 100644 index 0000000..9aa580e --- /dev/null +++ b/monshell2_sortie @@ -0,0 +1,9 @@ +>./monshell2.sh +entrez une valeur mavar: 1 +un +>./monshell2.sh +entrez une valeur mavar: 3 +trois ou cinq +>./monshell2.sh +entrez une valeur mavar: 10 +autre chose diff --git a/monshell3_sortie b/monshell3_sortie new file mode 100644 index 0000000..aa58ca5 --- /dev/null +++ b/monshell3_sortie @@ -0,0 +1,100 @@ +100 +99 +98 +97 +96 +95 +94 +93 +92 +91 +90 +89 +88 +87 +86 +85 +84 +83 +82 +81 +80 +79 +78 +77 +76 +75 +74 +73 +72 +71 +70 +69 +68 +67 +66 +65 +64 +63 +62 +61 +60 +59 +58 +57 +56 +55 +54 +53 +52 +51 +50 +49 +48 +47 +46 +45 +44 +43 +42 +41 +40 +39 +38 +37 +36 +35 +34 +33 +32 +31 +30 +29 +28 +27 +26 +25 +24 +23 +22 +21 +20 +19 +18 +17 +16 +15 +14 +13 +12 +11 +10 +9 +8 +7 +6 +5 +4 +3 +2 +1 diff --git a/monshell_sortie b/monshell_sortie new file mode 100644 index 0000000..6054fd8 --- /dev/null +++ b/monshell_sortie @@ -0,0 +1,7 @@ +Var1 : 15 +Var2 : 20 +var1 est plus petit que var2 +var1+var2=35 +Entrer var4 : 5 +Entrer var5 : 7 +var4 et var5 sont différents ! diff --git a/while.sh b/while.sh old mode 100644 new mode 100755