• # point d'exclamation dans une variable

    Posté par . En réponse au message point d'exclamation dans une variable. Évalué à 1. Dernière modification le 04 décembre 2012 à 16:36.

    Je vais être un peu plus exhaustif alors!

    la commande que j’exécute est :
    find . -iname "*.tif" -type f -printf "%f0円" | xargs -I {} -0 -n 1 -P 4 convert -resize "$aspect" {} -resize "$taille" -gravity center -background black -extent "$taille" -alpha off -depth 8 -type truecolor {}

    d'après un "ps -edf" lorsqu'elle est exécutée, elle est interprétée comme cela:
    find . -iname "*.tif" -type f -printf "%f0円" | xargs -I {} -0 -n 1 -P 4 convert -resize x! {} -resize 1998x1080 -gravity center -background black -extent 1998x1080 -alpha off -depth 8 -type truecolor {}

    Ce qui est étrange, c'est que ma variable $taille est bien interprétée mais pas la variable $aspect.

    Voici comment j'initialise mes variables:

    case 3ドル in
    scope)format="S" && taille="2048x858";;
    flat)format="F" && taille="1998x1080";;
    esac

    ratio=mediainfo --Inform="Video;%DisplayAspectRatio%" ../"1ドル"
    hauteur=mediainfo --Inform="Video;%Height%" ../"1ドル"
    hauteur=$hauteur!
    largeur=$(echo "$hauteur*$ratio" | tr -d $'\r' | bc | cut -d"." -f1)
    aspect="${largeur}x${hauteur}"!