[tab name=’♣ Exercice Linux’]
[/tab][tab name=’Correction’]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #!/bin/bash # ce script a pour nom process. # Il montre l'utilisation de la substitution de commande # et des tableaux. # Ce script affiche les noms de vos processus. # exemple: xstra> process # declare i i=7 declare i fin declare a PROCESSTAB PROCESSTAB=($(ps u $(id u))) FIN=${#PROCESSTAB[*]} until [ $i gt $FIN ] ;do echo "programme=${PROCESSTAB[$i]}" i=$i+4 done |
Exercice informatique, Correction exercice, Télécharger Exercice, Solution exercice, Exercice Linux
[/tab][end_tabset skin= »lightness » ]