|
|
|
|
Bonjour,
j'ai un souci avec 2 read en boucle dans un shell :
#!/bin/bash
L=1
while read ligne;do
while true;do
clear
echo "Supprimer \"$ligne\" ?"
reponse=""
read reponse
if [ "$reponse" = "o" ];then
sed -i $L'd' $1
break
elif [ "$reponse" != "" ];then
L=$(($L+1))
break
fi
done
done < mon_fichier
Je veux afficher chaque ligne pour en demander la suppression.
Bizarrement, la variable "$reponse" prend la valeur de "$ligne".
Très étrange non ? :-((
Configuration: Windows XP Firefox 2.0.0.7
Salut,
L=1 IFS=$'\n' for ligne in $(cat $1) do echo "Affichage ligne $L ?" read -e reponse if [ "$reponse" = "o" ] then echo $ligne fi L=$(expr $L + 1) done;-)) Z'@+...che. JP : Zen, my Nuggets ! ;-) Le savoir n'est bon que s'il est partagé. |