#1 Le 19/09/2008, à 19:50
- n3o51
[RESOLU]Renvoyer une liste dans Zenity ?
Bonsoir a tous ,voila j'aurais une questions.Je voudrais savoir comment renvoyer le contenue d'une liste dans Zenity imposant donc des choix multiples.
Je m'explique, j'ai en faite ceci :
dpkg -l | grep linux | grep ubuntu | grep ii | awk '{print $2}' | grep 2.6 >/tmp/clean_kernel.tmp
dpkg -l | grep linux | grep restricted | grep ii | awk '{print $2}' | grep 2.6 >>/tmp/clean_kernel.tmp
dpkg -l | grep linux | grep image| grep ii | awk '{print $2}' | grep 2.6 >>/tmp/clean_kernel.tmp
dpkg -l | grep linux | grep headers | grep ii | awk '{print $2}' | grep 2.6 >>/tmp/clean_kernel.tmp
Que je voudrais renvoyer dans un tableau pour Zenity comment faire s'il vous plait.
Merci vos pistes sont les bienvenues
Dernière modification par n3o51 (Le 20/09/2008, à 20:55)
Welcome to the real world
________________________________
Hors ligne
#2 Le 19/09/2008, à 22:04
- n3o51
Re : [RESOLU]Renvoyer une liste dans Zenity ?
Petit up !!!
Welcome to the real world
________________________________
Hors ligne
#3 Le 19/09/2008, à 22:37
- frafa
Re : [RESOLU]Renvoyer une liste dans Zenity ?
lo
dpkg -l | grep linux | grep ubuntu | grep ii | awk '{print $2}' | grep 2.6 >/tmp/clean_kernel.tmp
dpkg -l | grep linux | grep restricted | grep ii | awk '{print $2}' | grep 2.6 >>/tmp/clean_kernel.tmp
dpkg -l | grep linux | grep image| grep ii | awk '{print $2}' | grep 2.6 >>/tmp/clean_kernel.tmp
dpkg -l | grep linux | grep headers | grep ii | awk '{print $2}' | grep 2.6 >>/tmp/clean_kernel.tmp
LISTE=$(cat /tmp/clean_kernel.tmp | xargs);LISTE=(${LISTE[@]} $LISTE);MISEENFORME=();
while (( i < ${#LISTE[@]} ))
do
MISEENFORME=(${MISEENFORME[@]} FALSE ${LISTE[$i]})
(( i = i + 1 ))
done
CHOIX_ADDON=$(zenity \
--title="zzzzz" \
--text="Choisir l'option <b>désirée</b> dans la liste ci-dessous" \
--window-icon="/usr/share/pixmaps/gnome-debian.png" \
--width=600 \
--height=400 \
--list \
--print-column="2" \
--checklist \
--separator=" " \
--column="*" \
--column="Yoplaboum" \
${MISEENFORME[@]}
)
echo $CHOIX_ADDON
Dernière modification par frafa (Le 19/09/2008, à 22:41)
Hors ligne
#4 Le 19/09/2008, à 23:21
- n3o51
Re : [RESOLU]Renvoyer une liste dans Zenity ?
Ohhh lol tu en fait trop merci
Welcome to the real world
________________________________
Hors ligne
#5 Le 19/09/2008, à 23:33
- n3o51
Re : [RESOLU]Renvoyer une liste dans Zenity ?
Re bonsoir !!!
Mais ce que tu m'envoie me souleve un autre probleme dans le fichiers creer on obtiens une liste comme celle ci .
linux-ubuntu-modules-2.6.24-21-generic
linux-restricted-modules-2.6.24-21-generic
linux-image-2.6.24-21-generic
linux-headers-2.6.24-21
linux-headers-2.6.24-21-generic
Mais cette liste peut augmenter en fonction de noyau present hors le but de ceux script et en fonction des case cochés ou une ligne dans le fichier temporaire va remplacer une ligne = 1 choix possible donc je voudrai savoir est ce qu'il es possible en fonction des caches coches de n'effaces que celle ci ...
Welcome to the real world
________________________________
Hors ligne
#6 Le 20/09/2008, à 09:24
- frafa
Re : [RESOLU]Renvoyer une liste dans Zenity ?
lo
pas sur d'avoir bien compris,
c'est ca que tu veut:
FICHIER=$(dpkg -l | grep linux | grep -E "headers|restricted|image|headers|" | grep ii | awk '{print $2}' | grep 2.6 >/tmp/clean_kernel.tmp)
LISTE=$(cat /tmp/clean_kernel.tmp | xargs);LISTE=(${LISTE[@]} $LISTE);MISEENFORME=();
while (( i < ${#LISTE[@]} ))
do
MISEENFORME=(${MISEENFORME[@]} FALSE ${LISTE[$i]})
(( i = i + 1 ))
done
CHOIX_ADDON=$(zenity \
--title="zzzzz" \
--text="Choisir l'option <b>désirée</b> dans la liste ci-dessous" \
--window-icon="/usr/share/pixmaps/gnome-debian.png" \
--width=600 \
--height=400 \
--list \
--print-column="2" \
--checklist \
--separator="\n" \
--column="*" \
--column="Yoplaboum" \
${MISEENFORME[@]}
)
echo -e "$CHOIX_ADDON" | tee /tmp/clean_kernel.tmp
Hors ligne
#7 Le 20/09/2008, à 10:44
- n3o51
Re : [RESOLU]Renvoyer une liste dans Zenity ?
C'est tout a fait ca merci
tee
Welcome to the real world
________________________________
Hors ligne