#variable du fichier fichier="test.txt" #initialisation du compteur i=0 while IFS= read -r ligne; do #traitement des lignes 1 et 2 if [ "$i" -eq 1 ]; then echo "Nom: $ligne" elif [ "$i" -eq 2 ]; then echo "Prénom: $ligne" fi # incrementation du compteur i=$(($i+1)) done < "$fichier" exit 0