merci de ta reponse :
 -  1er point : c'est pour mes $BLA=`echo machin` que tu dis ca?
 
        ca me semblait marcher pourtant (bon j'ai modifié)
-  2eme point : ca a une reelle importance, ou c'est juste pour facilement visualiser une variable et ce qui n'en est pas une? (bon, j'ai modifier aussi)
 -  3eme point : c'etait pas deja fait? (enfin au moins pour celles qui peuvent poser probleme 
![[:cupra] [:cupra]](https://forum-images.hardware.fr/images/perso/cupra.gif)
 
voila, j'en suis la :
 Code :
 - #!/bin/bash
 - for ELEMENT in * ; do
 -     EXTENSION=$(echo $ELEMENT |awk -F "." '{print $NF}')
 -     case $EXTENSION in
 - 	JPG|jpg|jpeg|JPEG )
 - 	    echo traitement image : $ELEMENT
 - 	    TX=$(identify -format "%w" "${ELEMENT}" )
 - 	    TY=$(identify -format "%h" "${ELEMENT}" )
 - 	    DIF=$(echo $(($TX-$TY)))
 -      
 - 	    if [ $DIF -ge 0 ]; then
 -   if [ $TX -ge "1024" ];then
 -       rapport=$(echo $((102400/$TX)))
 -       echo $rapport
 -       convert $element -quality 80 -resize "${RAPPORT}"'%' 'th_'"${ELEMENT}"
 -   fi
 - 	    else
 -   if [ $TY -ge "1024" ];then
 -       rapport=$(echo $((102400/$TY)))
 -       echo $rapport
 -       convert $element -quality 80 -resize "${RAPPORT}"'%' 'th_'"${ELEMENT}"
 -   fi
 - 	    fi
 - 	    ;;
 -              * );;
 -     esac
 - done
 
  | 
 le message d'erreur qui en resulte est le suivant :
 Citation :
 
 convert: missing an image filename `th_ZZFacture_Bonnerue.jpg'.
   | 
  je me doute bien que c'est un probleme de concatenation, j'ai essayé d'elenver les simples quote pourvoir, meme resultat
 j'ai donc simplement essayé de concatené avant pour le %
 Code :
 - #!/bin/bash
 - for ELEMENT in * ; do
 -     EXTENSION=$(echo $ELEMENT |awk -F "." '{print $NF}')
 -     case $EXTENSION in
 - 	JPG|jpg|jpeg|JPEG )
 - 	    echo traitement image : $ELEMENT
 - 	    TX=$(identify -format "%w" "${ELEMENT}" )
 - 	    TY=$(identify -format "%h" "${ELEMENT}" )
 - 	    DIF=$(echo $(($TX-$TY)))
 -      
 - 	    if [ $DIF -ge 0 ]; then
 -   if [ $TX -ge "1024" ];then
 -       RAPPORT=$(echo $((102400/$TX)))
 -       RAPPORT="${RAPPORT}"'%'
 -       echo $RAPPORT
 -       convert $ELEMENT -quality 80 -resize "${RAPPORT}" 'th_'"${ELEMENT}"
 -   fi
 - 	    else
 -   if [ $TY -ge "1024" ];then
 -       RAPPORT=$(echo $((102400/$TY)))
 -       RAPPORT="${RAPPORT}"'%'
 -       echo $RAPPORT
 -       convert $ELEMENT -quality 80 -resize "${RAPPORT}" 'th_'"${ELEMENT}"
 -   fi
 - 	    fi
 - 	    ;;
 -              * );;
 -     esac
 - done
 
  | 
 et ca ca marche...
 donc, pour voir, j'ai essayé pour voir de mettre un antilash avant le % dans la premiere version de ce que j'ai fait, mais ca marchait pas 
 mais bon, j'ai une version qui marche, ca me suffit 
 
Message édité par kaillou38 le 02-07-2007 à 12:54:42
 ---------------
			
ras