Ajout sorties

This commit is contained in:
mael 2022-10-12 11:21:33 +02:00
parent e35f306744
commit 2861e147e6
8 changed files with 156 additions and 1 deletions

10
2_boucle_for_sortie Normal file
View File

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

19
2_while.sh Normal file → Executable file
View File

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

10
2_while_retour Normal file
View File

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

View File

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

9
monshell2_sortie Normal file
View File

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

100
monshell3_sortie Normal file
View File

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

7
monshell_sortie Normal file
View File

@ -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 !

0
while.sh Normal file → Executable file
View File